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

Unified Diff: chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h

Issue 74653002: sync: Add --enable-sync-sessions-v2 and necessary plumbing to use SessionsSyncManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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/toolbar/recent_tabs_sub_menu_model.h
diff --git a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h
index 3dbbc72bfc8add95f871d2fb707e5b372a1f5e21..ad175adad0a0975386f94c869fb0ef1a8398a3ea 100644
--- a/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h
+++ b/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h
@@ -20,7 +20,7 @@ class Browser;
struct SessionTab;
namespace browser_sync {
-class SessionModelAssociator;
+class OpenTabsUIDelegate;
}
namespace chrome {
@@ -47,11 +47,11 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
static const int kRecentlyClosedHeaderCommandId;
static const int kDisabledRecentlyClosedHeaderCommandId;
- // If |associator| is NULL, default associator for |browser|'s profile will
- // be used. Testing may require a specific |associator|.
+ // If |open_tabs_delegate| is NULL, the default delegate for |browser|'s
+ // profile will be used. Testing may require a specific |open_tabs_delegate|.
RecentTabsSubMenuModel(ui::AcceleratorProvider* accelerator_provider,
Browser* browser,
- browser_sync::SessionModelAssociator* associator);
+ browser_sync::OpenTabsUIDelegate* open_tabs_delegate);
virtual ~RecentTabsSubMenuModel();
// Overridden from ui::SimpleMenuModel::Delegate:
@@ -117,7 +117,13 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
// TabNavigationItems, and returns the corresponding local or other devices'
// TabNavigationItems in |tab_items|.
int CommandIdToTabVectorIndex(int command_id, TabNavigationItems** tab_items);
- browser_sync::SessionModelAssociator* GetModelAssociator();
+
+ // Used to access (and lazily initialize) open_tabs_delegate_.
+ // TODO(tim): This lazy-init for member variables is error prone because you
+ // can always skip going through the function and access the field directly.
+ // Consider instead having code just deal with potentially NULL open_tabs_
+ // and have it initialized by an event / callback.
+ browser_sync::OpenTabsUIDelegate* GetOpenTabsUIDelegate();
// Overridden from TabRestoreServiceObserver:
virtual void TabRestoreServiceChanged(TabRestoreService* service) OVERRIDE;
@@ -125,7 +131,7 @@ class RecentTabsSubMenuModel : public ui::SimpleMenuModel,
Browser* browser_; // Weak.
- browser_sync::SessionModelAssociator* associator_; // Weak.
+ browser_sync::OpenTabsUIDelegate* open_tabs_delegate_; // Weak.
// Accelerator for reopening last closed tab.
ui::Accelerator reopen_closed_tab_accelerator_;
« no previous file with comments | « chrome/browser/sync/test/integration/sessions_helper.cc ('k') | chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698