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

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

Issue 1400823003: Creates BrowserTabStripTracker to consolidate common code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback and git cl format Created 5 years, 2 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/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 74c43aa0ce8f10f7b65d9cadc36528b2dcfdf5da..c2b628254305077c82b116cdc5706f681bd491b0 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_api.h
@@ -15,7 +15,8 @@
#include "chrome/browser/extensions/api/web_navigation/frame_navigation_state.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser_list_observer.h"
+#include "chrome/browser/ui/browser_tab_strip_tracker.h"
+#include "chrome/browser/ui/browser_tab_strip_tracker_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -112,7 +113,7 @@ class WebNavigationTabObserver
// Observes navigation notifications and routes them as events to the extension
// system.
class WebNavigationEventRouter : public TabStripModelObserver,
- public chrome::BrowserListObserver,
+ public BrowserTabStripTrackerDelegate,
public content::NotificationObserver {
public:
explicit WebNavigationEventRouter(Profile* profile);
@@ -134,16 +135,15 @@ class WebNavigationEventRouter : public TabStripModelObserver,
GURL target_url;
};
+ // BrowserTabStripTrackerDelegate implementation.
+ bool ShouldTrackBrowser(Browser* browser) override;
+
// TabStripModelObserver implementation.
void TabReplacedAt(TabStripModel* tab_strip_model,
content::WebContents* old_contents,
content::WebContents* new_contents,
int index) override;
- // chrome::BrowserListObserver implementation.
- void OnBrowserAdded(Browser* browser) override;
- void OnBrowserRemoved(Browser* browser) override;
-
// content::NotificationObserver implementation.
void Observe(int type,
const content::NotificationSource& source,
@@ -172,6 +172,8 @@ class WebNavigationEventRouter : public TabStripModelObserver,
// The profile that owns us via ExtensionService.
Profile* profile_;
+ BrowserTabStripTracker browser_tab_strip_tracker_;
+
DISALLOW_COPY_AND_ASSIGN(WebNavigationEventRouter);
};

Powered by Google App Engine
This is Rietveld 408576698