OLD | NEW |
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 22 matching lines...) Expand all Loading... |
33 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" | 33 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" |
34 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 34 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
35 #include "chrome/common/extensions/extension_constants.h" | 35 #include "chrome/common/extensions/extension_constants.h" |
36 #include "chrome/common/page_transition_types.h" | 36 #include "chrome/common/page_transition_types.h" |
37 #include "chrome/common/page_zoom.h" | 37 #include "chrome/common/page_zoom.h" |
38 #include "content/browser/tab_contents/page_navigator.h" | 38 #include "content/browser/tab_contents/page_navigator.h" |
39 #include "content/browser/tab_contents/tab_contents_delegate.h" | 39 #include "content/browser/tab_contents/tab_contents_delegate.h" |
40 #include "content/common/notification_registrar.h" | 40 #include "content/common/notification_registrar.h" |
41 #include "ui/gfx/rect.h" | 41 #include "ui/gfx/rect.h" |
42 | 42 |
| 43 class BrowserTabRestoreServiceDelegate; |
43 class BrowserWindow; | 44 class BrowserWindow; |
44 class Extension; | 45 class Extension; |
45 class FindBarController; | 46 class FindBarController; |
46 class InstantController; | 47 class InstantController; |
47 class InstantUnloadHandler; | 48 class InstantUnloadHandler; |
48 class PrefService; | 49 class PrefService; |
49 class Profile; | 50 class Profile; |
50 class SessionStorageNamespace; | 51 class SessionStorageNamespace; |
51 class SkBitmap; | 52 class SkBitmap; |
52 class StatusBubble; | 53 class StatusBubble; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 BrowserTabRestoreServiceDelegate* tab_restore_service_delegate() { |
| 206 return tab_restore_service_delegate_.get(); |
| 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 Loading... |
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 Loading... |
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 scoped_ptr<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_ |
OLD | NEW |