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

Unified Diff: chrome/browser/extensions/api/web_navigation/web_navigation_api.h

Issue 10964048: Switch WebNavigationTabObserver to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/web_navigation/web_navigation_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_navigation/web_navigation_api.h
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
index 7f5868e3be7de5559c62fa2cd293721602bfc0cb..46b59107e9714ac35c9af5d5d36c8ad8b0e4b5e9 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
@@ -15,6 +15,7 @@
#include "chrome/browser/extensions/api/web_navigation/frame_navigation_state.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/tab_contents/web_contents_user_data.h"
#include "chrome/browser/ui/browser_list_observer.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "content/public/browser/notification_observer.h"
@@ -27,10 +28,11 @@ struct RetargetingDetails;
namespace extensions {
// Tab contents observer that forwards navigation events to the event router.
-class WebNavigationTabObserver : public content::NotificationObserver,
- public content::WebContentsObserver {
+class WebNavigationTabObserver
+ : public content::NotificationObserver,
+ public content::WebContentsObserver,
+ public WebContentsUserData<WebNavigationTabObserver> {
public:
- explicit WebNavigationTabObserver(content::WebContents* web_contents);
virtual ~WebNavigationTabObserver();
// Returns the object for the given |tab_contents|.
@@ -94,6 +96,10 @@ class WebNavigationTabObserver : public content::NotificationObserver,
virtual void WebContentsDestroyed(content::WebContents* tab) OVERRIDE;
private:
+ explicit WebNavigationTabObserver(content::WebContents* web_contents);
+ static int kUserDataKey;
+ friend class WebContentsUserData<WebNavigationTabObserver>;
+
// True if the transition and target url correspond to a reference fragment
// navigation.
bool IsReferenceFragmentNavigation(FrameNavigationState::FrameID frame_id,
« no previous file with comments | « no previous file | chrome/browser/extensions/api/web_navigation/web_navigation_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698