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

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

Issue 10959045: Switch WebIntentPickerController to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 78d3c37b2cc718a3599e641c654715049b24985b..ffee1bcda60f04d0be944d98b2d64d0721dc2584 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.h
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.h
@@ -17,6 +17,7 @@
#include "chrome/browser/intents/cws_intents_registry.h"
#include "chrome/browser/intents/web_intents_registry.h"
#include "chrome/browser/intents/web_intents_reporting.h"
+#include "chrome/browser/tab_contents/web_contents_user_data.h"
#include "chrome/browser/ui/intents/web_intent_picker_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -27,7 +28,7 @@
class Browser;
struct DefaultWebIntentService;
class GURL;
-class TabContents;
+class Profile;
class WebIntentPicker;
class WebIntentPickerModel;
@@ -45,7 +46,8 @@ struct WebIntentServiceData;
class WebIntentPickerController
: public content::NotificationObserver,
public WebIntentPickerDelegate,
- public extensions::WebstoreInstaller::Delegate {
+ public extensions::WebstoreInstaller::Delegate,
+ public WebContentsUserData<WebIntentPickerController> {
public:
// The various states that the UI may be in. Public for testing.
@@ -66,7 +68,6 @@ class WebIntentPickerController
kPickerEventAsyncDataComplete, // Data from registry and CWS has arrived.
};
- explicit WebIntentPickerController(TabContents* tab_contents);
virtual ~WebIntentPickerController();
// Sets the intent data and return pathway handler object for which
@@ -118,6 +119,10 @@ class WebIntentPickerController
const std::string& error) OVERRIDE;
private:
+ explicit WebIntentPickerController(content::WebContents* web_contents);
+ static int kUserDataKey;
James Hawkins 2012/09/25 17:46:25 Is this used anywhere? If so please document it.
Avi (use Gerrit) 2012/09/25 18:14:36 Yes it is. It's part of the WebContentsUserData ma
+ friend class WebContentsUserData<WebIntentPickerController>;
+
friend class WebIntentPickerControllerTest;
friend class WebIntentPickerControllerBrowserTest;
friend class WebIntentPickerControllerIncognitoBrowserTest;
@@ -246,8 +251,11 @@ class WebIntentPickerController
WebIntentPickerState dialog_state_; // Current state of the dialog.
- // A weak pointer to the tab contents that the picker is displayed on.
- TabContents* tab_contents_;
+ // A weak pointer to the web contents that the picker is displayed on.
+ content::WebContents* web_contents_;
+
+ // A weak pointer to the profile for the web contents.
+ Profile* profile_;
// A notification registrar, listening for notifications when the tab closes
// to close the picker ui.
« 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