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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 TabContentsWrapper* GetTabContentsWrapperAt(int index) const; | 346 TabContentsWrapper* GetTabContentsWrapperAt(int index) const; |
343 // Same as above but correctly handles if GetSelectedTabContents() is NULL | 347 // Same as above but correctly handles if GetSelectedTabContents() is NULL |
344 // in the model before dereferencing to get the raw TabContents. | 348 // in the model before dereferencing to get the raw TabContents. |
345 // TODO(pinkerton): These should really be returning TabContentsWrapper | 349 // TODO(pinkerton): These should really be returning TabContentsWrapper |
346 // objects, but that would require changing about 50+ other files. In order | 350 // objects, but that would require changing about 50+ other files. In order |
347 // to keep changes localized, the default is to return a TabContents. Note | 351 // to keep changes localized, the default is to return a TabContents. Note |
348 // this differs from the TabStripModel because it has far fewer clients. | 352 // this differs from the TabStripModel because it has far fewer clients. |
349 TabContents* GetSelectedTabContents() const; | 353 TabContents* GetSelectedTabContents() const; |
350 TabContents* GetTabContentsAt(int index) const; | 354 TabContents* GetTabContentsAt(int index) const; |
351 void SelectTabContentsAt(int index, bool user_gesture); | 355 void SelectTabContentsAt(int index, bool user_gesture); |
| 356 bool IsTabPinned(int index) const; |
352 void CloseAllTabs(); | 357 void CloseAllTabs(); |
353 | 358 |
354 // Tab adding/showing functions ///////////////////////////////////////////// | 359 // Tab adding/showing functions ///////////////////////////////////////////// |
355 | 360 |
356 // Returns true if the tab strip is editable (for extensions). | 361 // Returns true if the tab strip is editable (for extensions). |
357 bool IsTabStripEditable() const; | 362 bool IsTabStripEditable() const; |
358 | 363 |
359 // Returns the index to insert a tab at during session restore and startup. | 364 // Returns the index to insert a tab at during session restore and startup. |
360 // |relative_index| gives the index of the url into the number of tabs that | 365 // |relative_index| gives the index of the url into the number of tabs that |
361 // are going to be opened. For example, if three urls are passed in on the | 366 // are going to be opened. For example, if three urls are passed in on the |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 // from a TabContents. Currently, only one pending action is allowed. | 1156 // from a TabContents. Currently, only one pending action is allowed. |
1152 WebAppAction pending_web_app_action_; | 1157 WebAppAction pending_web_app_action_; |
1153 | 1158 |
1154 // Tracks the display mode of the tabstrip. | 1159 // Tracks the display mode of the tabstrip. |
1155 mutable BooleanPrefMember use_vertical_tabs_; | 1160 mutable BooleanPrefMember use_vertical_tabs_; |
1156 | 1161 |
1157 // The profile's tab restore service. The service is owned by the profile, | 1162 // The profile's tab restore service. The service is owned by the profile, |
1158 // and we install ourselves as an observer. | 1163 // and we install ourselves as an observer. |
1159 TabRestoreService* tab_restore_service_; | 1164 TabRestoreService* tab_restore_service_; |
1160 | 1165 |
| 1166 // Helper which implements the TabRestoreServiceDelegate interface. |
| 1167 scoped_ptr<BrowserTabRestoreServiceDelegate> tab_restore_service_delegate_; |
| 1168 |
1161 scoped_ptr<InstantController> instant_; | 1169 scoped_ptr<InstantController> instant_; |
1162 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; | 1170 scoped_ptr<InstantUnloadHandler> instant_unload_handler_; |
1163 | 1171 |
1164 DISALLOW_COPY_AND_ASSIGN(Browser); | 1172 DISALLOW_COPY_AND_ASSIGN(Browser); |
1165 }; | 1173 }; |
1166 | 1174 |
1167 #endif // CHROME_BROWSER_UI_BROWSER_H_ | 1175 #endif // CHROME_BROWSER_UI_BROWSER_H_ |
OLD | NEW |