Add WebstoreInlineInstaller (downloads store data, shows the install UI, and starts the install).

The flow is:
1. Fetch store metadata as JSON (using URLFetcher)
2. Parse response in utility process (via SafeWebstoreResponseParser)
3. Parse manifest and get icon data using WebstoreInstallHelper
4. Show install UI
5. Whitelist extension ID for download and start download

Still missing are a way of informing the page that the inline install succeeded
or failed.

Also removes ExtensionTabHelper::GetCustomFrameNativeWindow, since it wasn't
actually overriding anything (the method was removed from
ExtensionFunctionDispatcher::Delegate by r74835).

[email protected]

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98712 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/extensions/extension_tab_helper.h b/chrome/browser/extensions/extension_tab_helper.h
index b5f16848..1b1b5ad 100644
--- a/chrome/browser/extensions/extension_tab_helper.h
+++ b/chrome/browser/extensions/extension_tab_helper.h
@@ -9,6 +9,7 @@
 #include "content/browser/tab_contents/tab_contents_observer.h"
 #include "chrome/browser/extensions/extension_function_dispatcher.h"
 #include "chrome/browser/extensions/image_loading_tracker.h"
+#include "chrome/browser/extensions/webstore_inline_installer.h"
 #include "chrome/common/web_apps.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 
@@ -23,7 +24,8 @@
 // Per-tab extension helper. Also handles non-extension apps.
 class ExtensionTabHelper : public TabContentsObserver,
                            public ExtensionFunctionDispatcher::Delegate,
-                           public ImageLoadingTracker::Observer {
+                           public ImageLoadingTracker::Observer,
+                           public WebstoreInlineInstaller::Delegate {
  public:
   explicit ExtensionTabHelper(TabContentsWrapper* wrapper);
   virtual ~ExtensionTabHelper();
@@ -85,13 +87,12 @@
   virtual void DidNavigateMainFramePostCommit(
       const content::LoadCommittedDetails& details,
       const ViewHostMsg_FrameNavigate_Params& params) OVERRIDE;
-  virtual bool OnMessageReceived(const IPC::Message& message);
+  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
 
   // ExtensionFunctionDispatcher::Delegate overrides.
-  virtual Browser* GetBrowser();
-  virtual gfx::NativeView GetNativeViewOfHost();
-  virtual gfx::NativeWindow GetCustomFrameNativeWindow();
-  virtual TabContents* GetAssociatedTabContents() const;
+  virtual Browser* GetBrowser() OVERRIDE;
+  virtual gfx::NativeView GetNativeViewOfHost() OVERRIDE;
+  virtual TabContents* GetAssociatedTabContents() const OVERRIDE;
 
   // Message handlers.
   void OnDidGetApplicationInfo(int32 page_id, const WebApplicationInfo& info);
@@ -107,7 +108,11 @@
 
   // ImageLoadingTracker::Observer.
   virtual void OnImageLoaded(SkBitmap* image, const ExtensionResource& resource,
-                             int index);
+                             int index) OVERRIDE;
+
+  // WebstoreInlineInstaller::Delegate.
+  virtual void OnInlineInstallSuccess() OVERRIDE;
+  virtual void OnInlineInstallFailure(const std::string& error) OVERRIDE;
 
   // Data for app extensions ---------------------------------------------------