Rejiggers the keyword editor so that the UI is independent of the model rather than being derived from it. This reduces the spaghetti somewhat. Also decouples the notion of a native view hierarchy from the location in TabContents::PageHasOSDD where the template URL fetcher is spawned. The Template URL Fetcher now simply retains a reference to the TabContents that created it. If the TabContents is destroyed before the fetch completes, we just discard the data retrieved without adding a keyword.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/140054

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19003 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 53e074c..bde80b185 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2032,12 +2032,11 @@
 
   // Download the OpenSearch description document. If this is successful a
   // new keyword will be created when done.
-  gfx::NativeWindow ancestor = view_->GetTopLevelNativeWindow();
   profile()->GetTemplateURLFetcher()->ScheduleDownload(
       keyword,
       url,
       base_entry->favicon().url(),
-      ancestor,
+      this,
       autodetected);
 }