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

Side by Side Diff: chrome/browser/ui/browser.h

Issue 6660028: Decouple TabRestoreService from Browser (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: New version using a seperate class for the delegate Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_BROWSER_H_ 5 #ifndef CHROME_BROWSER_UI_BROWSER_H_
6 #define CHROME_BROWSER_UI_BROWSER_H_ 6 #define CHROME_BROWSER_UI_BROWSER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/debugger/devtools_toggle_action.h" 21 #include "chrome/browser/debugger/devtools_toggle_action.h"
22 #include "chrome/browser/instant/instant_delegate.h" 22 #include "chrome/browser/instant/instant_delegate.h"
23 #include "chrome/browser/prefs/pref_member.h" 23 #include "chrome/browser/prefs/pref_member.h"
24 #include "chrome/browser/sessions/session_id.h" 24 #include "chrome/browser/sessions/session_id.h"
25 #include "chrome/browser/sessions/tab_restore_service_observer.h" 25 #include "chrome/browser/sessions/tab_restore_service_observer.h"
26 #include "chrome/browser/sync/profile_sync_service_observer.h" 26 #include "chrome/browser/sync/profile_sync_service_observer.h"
27 #include "chrome/browser/tabs/tab_handler.h" 27 #include "chrome/browser/tabs/tab_handler.h"
28 #include "chrome/browser/tabs/tab_strip_model_delegate.h" // TODO(beng): remove 28 #include "chrome/browser/tabs/tab_strip_model_delegate.h" // TODO(beng): remove
29 #include "chrome/browser/tabs/tab_strip_model_observer.h" // TODO(beng): remove 29 #include "chrome/browser/tabs/tab_strip_model_observer.h" // TODO(beng): remove
30 #include "chrome/browser/ui/browser_navigator.h" 30 #include "chrome/browser/ui/browser_navigator.h"
31 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h"
31 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h" 32 #include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h"
32 #include "chrome/browser/ui/shell_dialogs.h" 33 #include "chrome/browser/ui/shell_dialogs.h"
33 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" 34 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h"
34 #include "chrome/browser/ui/toolbar/toolbar_model.h" 35 #include "chrome/browser/ui/toolbar/toolbar_model.h"
35 #include "chrome/common/extensions/extension_constants.h" 36 #include "chrome/common/extensions/extension_constants.h"
36 #include "chrome/common/page_transition_types.h" 37 #include "chrome/common/page_transition_types.h"
37 #include "chrome/common/page_zoom.h" 38 #include "chrome/common/page_zoom.h"
38 #include "content/browser/tab_contents/page_navigator.h" 39 #include "content/browser/tab_contents/page_navigator.h"
39 #include "content/browser/tab_contents/tab_contents_delegate.h" 40 #include "content/browser/tab_contents/tab_contents_delegate.h"
40 #include "content/common/notification_registrar.h" 41 #include "content/common/notification_registrar.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 195 }
195 #endif 196 #endif
196 197
197 // |window()| will return NULL if called before |CreateBrowserWindow()| 198 // |window()| will return NULL if called before |CreateBrowserWindow()|
198 // is done. 199 // is done.
199 BrowserWindow* window() const { return window_; } 200 BrowserWindow* window() const { return window_; }
200 ToolbarModel* toolbar_model() { return &toolbar_model_; } 201 ToolbarModel* toolbar_model() { return &toolbar_model_; }
201 const SessionID& session_id() const { return session_id_; } 202 const SessionID& session_id() const { return session_id_; }
202 CommandUpdater* command_updater() { return &command_updater_; } 203 CommandUpdater* command_updater() { return &command_updater_; }
203 bool block_command_execution() const { return block_command_execution_; } 204 bool block_command_execution() const { return block_command_execution_; }
205 TabRestoreServiceDelegate* tab_restore_service_delegate() {
206 return &tab_restore_service_delegate_;
207 }
204 208
205 // Get the FindBarController for this browser, creating it if it does not 209 // Get the FindBarController for this browser, creating it if it does not
206 // yet exist. 210 // yet exist.
207 FindBarController* GetFindBarController(); 211 FindBarController* GetFindBarController();
208 212
209 // Returns true if a FindBarController exists for this browser. 213 // Returns true if a FindBarController exists for this browser.
210 bool HasFindBarController() const; 214 bool HasFindBarController() const;
211 215
212 // Setters ///////////////////////////////////////////////////////////////// 216 // Setters /////////////////////////////////////////////////////////////////
213 217
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 TabContentsWrapper* GetTabContentsWrapperAt(int index) const; 345 TabContentsWrapper* GetTabContentsWrapperAt(int index) const;
342 // Same as above but correctly handles if GetSelectedTabContents() is NULL 346 // Same as above but correctly handles if GetSelectedTabContents() is NULL
343 // in the model before dereferencing to get the raw TabContents. 347 // in the model before dereferencing to get the raw TabContents.
344 // TODO(pinkerton): These should really be returning TabContentsWrapper 348 // TODO(pinkerton): These should really be returning TabContentsWrapper
345 // objects, but that would require changing about 50+ other files. In order 349 // objects, but that would require changing about 50+ other files. In order
346 // to keep changes localized, the default is to return a TabContents. Note 350 // to keep changes localized, the default is to return a TabContents. Note
347 // this differs from the TabStripModel because it has far fewer clients. 351 // this differs from the TabStripModel because it has far fewer clients.
348 TabContents* GetSelectedTabContents() const; 352 TabContents* GetSelectedTabContents() const;
349 TabContents* GetTabContentsAt(int index) const; 353 TabContents* GetTabContentsAt(int index) const;
350 void SelectTabContentsAt(int index, bool user_gesture); 354 void SelectTabContentsAt(int index, bool user_gesture);
355 bool IsTabPinned(int index) const;
351 void CloseAllTabs(); 356 void CloseAllTabs();
352 357
353 // Tab adding/showing functions ///////////////////////////////////////////// 358 // Tab adding/showing functions /////////////////////////////////////////////
354 359
355 // Returns true if the tab strip is editable (for extensions). 360 // Returns true if the tab strip is editable (for extensions).
356 bool IsTabStripEditable() const; 361 bool IsTabStripEditable() const;
357 362
358 // Returns the index to insert a tab at during session restore and startup. 363 // Returns the index to insert a tab at during session restore and startup.
359 // |relative_index| gives the index of the url into the number of tabs that 364 // |relative_index| gives the index of the url into the number of tabs that
360 // are going to be opened. For example, if three urls are passed in on the 365 // are going to be opened. For example, if three urls are passed in on the
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1144 // from a TabContents. Currently, only one pending action is allowed. 1149 // from a TabContents. Currently, only one pending action is allowed.
1145 WebAppAction pending_web_app_action_; 1150 WebAppAction pending_web_app_action_;
1146 1151
1147 // Tracks the display mode of the tabstrip. 1152 // Tracks the display mode of the tabstrip.
1148 mutable BooleanPrefMember use_vertical_tabs_; 1153 mutable BooleanPrefMember use_vertical_tabs_;
1149 1154
1150 // The profile's tab restore service. The service is owned by the profile, 1155 // The profile's tab restore service. The service is owned by the profile,
1151 // and we install ourselves as an observer. 1156 // and we install ourselves as an observer.
1152 TabRestoreService* tab_restore_service_; 1157 TabRestoreService* tab_restore_service_;
1153 1158
1159 // Helper which implements the TabRestoreServiceDelegate interface.
1160 BrowserTabRestoreServiceDelegate tab_restore_service_delegate_;
1161
1154 scoped_ptr<InstantController> instant_; 1162 scoped_ptr<InstantController> instant_;
1155 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; 1163 scoped_ptr<InstantUnloadHandler> instant_unload_handler_;
1156 1164
1157 DISALLOW_COPY_AND_ASSIGN(Browser); 1165 DISALLOW_COPY_AND_ASSIGN(Browser);
1158 }; 1166 };
1159 1167
1160 #endif // CHROME_BROWSER_UI_BROWSER_H_ 1168 #endif // CHROME_BROWSER_UI_BROWSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698