Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3365)

Unified Diff: chrome/browser/ui/intents/web_intent_picker_controller.h

Issue 9763001: [Web Intents] Inline installation of extensions in web intents picker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac fix Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/intents/web_intent_picker_controller.h
diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.h b/chrome/browser/ui/intents/web_intent_picker_controller.h
index ee6ce0e3b2254810c5e33c01c3bf3fc9f6d898ed..63112c4143458b3250aee9f5d2d8651576b4f8df 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.h
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.h
@@ -9,9 +9,11 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/string16.h"
+#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/intents/web_intents_registry.h"
#include "chrome/browser/intents/cws_intents_registry.h"
@@ -27,6 +29,7 @@ class GURL;
class TabContentsWrapper;
class WebIntentPicker;
class WebIntentPickerModel;
+class WebstoreInstaller;
namespace content {
class WebContents;
@@ -41,7 +44,7 @@ struct WebIntentServiceData;
// intent handler choice back to the TabContents object.
class WebIntentPickerController : public content::NotificationObserver,
public WebIntentPickerDelegate,
- public WebIntentsRegistry::Consumer {
+ public WebstoreInstaller::Delegate {
public:
// Takes ownership of |factory|.
explicit WebIntentPickerController(TabContentsWrapper* wrapper);
@@ -69,9 +72,15 @@ class WebIntentPickerController : public content::NotificationObserver,
Disposition disposition) OVERRIDE;
virtual void OnInlineDispositionWebContentsCreated(
content::WebContents* web_contents) OVERRIDE;
+ virtual void OnExtensionInstallRequested(const std::string& id) OVERRIDE;
virtual void OnCancelled() OVERRIDE;
virtual void OnClosing() OVERRIDE;
+ // WebstoreInstaller::Delegate implementation.
+ virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE;
+ virtual void OnExtensionInstallFailure(const std::string& id,
+ const std::string& error) OVERRIDE;
+
private:
friend class WebIntentPickerControllerTest;
friend class WebIntentPickerControllerBrowserTest;
@@ -90,14 +99,8 @@ class WebIntentPickerController : public content::NotificationObserver,
}
// Called when WebIntentServiceData is returned from the WebIntentsRegistry.
- virtual void OnIntentsQueryDone(
- WebIntentsRegistry::QueryID,
- const std::vector<webkit_glue::WebIntentServiceData>& services) OVERRIDE;
-
- // Called when the WebIntentsRegistry returns responses to a defaults request.
- virtual void OnIntentsDefaultsQueryDone(
- WebIntentsRegistry::QueryID,
- const DefaultWebIntentService& default_service) OVERRIDE;
+ void OnWebIntentServicesAvailable(
+ const std::vector<webkit_glue::WebIntentServiceData>& services);
// Called when FaviconData is returned from the FaviconService.
void OnFaviconDataAvailable(FaviconService::Handle handle,
@@ -126,6 +129,12 @@ class WebIntentPickerController : public content::NotificationObserver,
// Called when an extension's icon failed to be decoded or resized.
void OnExtensionIconUnavailable(const string16& extension_id);
+ // When an extension is installed, all that is known is the extension id.
+ // This callback receives the intent service data for that extension.
+ // |services| must be a non-empty list.
+ void OnExtensionInstallServiceAvailable(
+ const std::vector<webkit_glue::WebIntentServiceData>& services);
+
// Decrements the |pending_async_count_| and notifies the picker if it
// reaches zero.
void AsyncOperationFinished();
@@ -167,6 +176,9 @@ class WebIntentPickerController : public content::NotificationObserver,
// Request consumer used when asynchronously loading favicons.
CancelableRequestConsumerTSimple<size_t> favicon_consumer_;
+ // Used to install extensions from the Chrome Web Store.
+ scoped_refptr<WebstoreInstaller> webstore_installer_;
+
base::WeakPtrFactory<WebIntentPickerController> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController);
« no previous file with comments | « chrome/browser/ui/intents/web_intent_picker.h ('k') | chrome/browser/ui/intents/web_intent_picker_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698