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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_event_router.h

Issue 2142413003: Adding Discarded property support for onUpdate function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@API_Discarded
Patch Set: nit fixed Created 4 years, 5 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/tabs/tabs_event_router.h
diff --git a/chrome/browser/extensions/api/tabs/tabs_event_router.h b/chrome/browser/extensions/api/tabs/tabs_event_router.h
index 5468d913ec73350a9cff7917a5d6c874132bbd87..bae63dcdfe2d20c568907ef1b16372075a6f0a67 100644
--- a/chrome/browser/extensions/api/tabs/tabs_event_router.h
+++ b/chrome/browser/extensions/api/tabs/tabs_event_router.h
@@ -12,6 +12,8 @@
#include "base/macros.h"
#include "base/scoped_observer.h"
#include "chrome/browser/extensions/api/tabs/tabs_api.h"
+#include "chrome/browser/memory/tab_manager.h"
+#include "chrome/browser/memory/tab_manager_observer.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"
@@ -39,7 +41,8 @@ class TabsEventRouter : public TabStripModelObserver,
public BrowserTabStripTrackerDelegate,
public chrome::BrowserListObserver,
public favicon::FaviconDriverObserver,
- public zoom::ZoomObserver {
+ public zoom::ZoomObserver,
+ public memory::TabManagerObserver {
public:
explicit TabsEventRouter(Profile* profile);
~TabsEventRouter() override;
@@ -88,6 +91,10 @@ class TabsEventRouter : public TabStripModelObserver,
bool icon_url_changed,
const gfx::Image& image) override;
+ // memory::TabManagerObserver:
+ void OnDiscardedStateChange(content::WebContents* contents,
+ bool is_discarded) override;
+
private:
// "Synthetic" event. Called from TabInsertedAt if new tab is detected.
void TabCreatedAt(content::WebContents* contents, int index, bool active);
@@ -196,6 +203,9 @@ class TabsEventRouter : public TabStripModelObserver,
BrowserTabStripTracker browser_tab_strip_tracker_;
+ ScopedObserver<memory::TabManager, TabsEventRouter>
+ tab_manager_scoped_observer_;
+
DISALLOW_COPY_AND_ASSIGN(TabsEventRouter);
};
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_constants.cc ('k') | chrome/browser/extensions/api/tabs/tabs_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698