OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BROWSER_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_H_ |
6 #define CHROME_BROWSER_BROWSER_H_ | 6 #define CHROME_BROWSER_BROWSER_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "chrome/browser/browser_process.h" |
8 #include "chrome/browser/controller.h" | 11 #include "chrome/browser/controller.h" |
9 #include "chrome/browser/shell_dialogs.h" | 12 #include "chrome/browser/shell_dialogs.h" |
10 #include "chrome/browser/browser_window.h" | 13 #include "chrome/browser/browser_window.h" |
11 #include "chrome/browser/session_id.h" | 14 #include "chrome/browser/session_id.h" |
12 #include "chrome/browser/tab_contents.h" | 15 #include "chrome/browser/tab_contents.h" |
13 #include "chrome/browser/tab_contents_delegate.h" | 16 #include "chrome/browser/tab_contents_delegate.h" |
14 #include "chrome/browser/tabs/tab_strip_model.h" | 17 #include "chrome/browser/tabs/tab_strip_model.h" |
15 #include "chrome/browser/toolbar_model.h" | 18 #include "chrome/browser/toolbar_model.h" |
16 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
17 #include "chrome/common/pref_member.h" | 20 #include "chrome/common/pref_member.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 72 |
70 // Creates the Browser Window. Prefer to use the static helpers above where | 73 // Creates the Browser Window. Prefer to use the static helpers above where |
71 // possible. This does not show the window. You need to call window()->Show() | 74 // possible. This does not show the window. You need to call window()->Show() |
72 // to show it. | 75 // to show it. |
73 void CreateBrowserWindow(); | 76 void CreateBrowserWindow(); |
74 | 77 |
75 // Accessors //////////////////////////////////////////////////////////////// | 78 // Accessors //////////////////////////////////////////////////////////////// |
76 | 79 |
77 Type type() const { return type_; } | 80 Type type() const { return type_; } |
78 Profile* profile() const { return profile_; } | 81 Profile* profile() const { return profile_; } |
| 82 const std::vector<std::wstring>& user_data_dir_profiles() const { |
| 83 return g_browser_process->user_data_dir_profiles(); |
| 84 } |
79 BrowserWindow* window() const { return window_; } | 85 BrowserWindow* window() const { return window_; } |
80 ToolbarModel* toolbar_model() { return &toolbar_model_; } | 86 ToolbarModel* toolbar_model() { return &toolbar_model_; } |
81 const SessionID& session_id() const { return session_id_; } | 87 const SessionID& session_id() const { return session_id_; } |
82 CommandController* controller() { return &controller_; } | 88 CommandController* controller() { return &controller_; } |
83 | 89 |
| 90 // Setters ///////////////////////////////////////////////////////////////// |
| 91 |
| 92 void set_user_data_dir_profiles(const std::vector<std::wstring>& profiles) { |
| 93 g_browser_process->user_data_dir_profiles() = profiles; |
| 94 } |
| 95 |
84 // Browser Creation Helpers ///////////////////////////////////////////////// | 96 // Browser Creation Helpers ///////////////////////////////////////////////// |
85 | 97 |
86 // Opens a new window with the default blank tab. | 98 // Opens a new window with the default blank tab. |
87 static void OpenEmptyWindow(Profile* profile); | 99 static void OpenEmptyWindow(Profile* profile); |
88 | 100 |
89 // Opens the specified URL in a new browser window in an incognito session. | 101 // Opens the specified URL in a new browser window in an incognito session. |
90 // If there is already an existing active incognito session for the specified | 102 // If there is already an existing active incognito session for the specified |
91 // |profile|, that session is re-used. | 103 // |profile|, that session is re-used. |
92 static void OpenURLOffTheRecord(Profile* profile, const GURL& url); | 104 static void OpenURLOffTheRecord(Profile* profile, const GURL& url); |
93 | 105 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 void Stop(); | 222 void Stop(); |
211 void Home(); | 223 void Home(); |
212 void Go(); | 224 void Go(); |
213 void OpenCurrentURL(); | 225 void OpenCurrentURL(); |
214 | 226 |
215 // Window management commands | 227 // Window management commands |
216 void NewTab(); | 228 void NewTab(); |
217 void CloseTab(); | 229 void CloseTab(); |
218 void CloseApp(); | 230 void CloseApp(); |
219 void NewWindow(); | 231 void NewWindow(); |
| 232 // Commands to create a new window in a specific profile. |
| 233 void NewProfileWindowByName(const std::wstring& profile); |
| 234 // The index starts with 0, and specifies the index in the profiles vector. |
| 235 void NewProfileWindowByIndex(int index); |
220 void NewIncognitoWindow(); | 236 void NewIncognitoWindow(); |
221 void CloseWindow(); | 237 void CloseWindow(); |
222 void SelectNextTab(); | 238 void SelectNextTab(); |
223 void SelectPreviousTab(); | 239 void SelectPreviousTab(); |
224 void SelectNumberedTab(int index); | 240 void SelectNumberedTab(int index); |
225 void SelectLastTab(); | 241 void SelectLastTab(); |
226 void DuplicateTab(); | 242 void DuplicateTab(); |
227 void RestoreTab(); | 243 void RestoreTab(); |
228 void ConvertPopupToTabbedBrowser(); | 244 void ConvertPopupToTabbedBrowser(); |
229 void Exit(); | 245 void Exit(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 void OpenPasswordManager(); | 285 void OpenPasswordManager(); |
270 void OpenAboutChromeDialog(); | 286 void OpenAboutChromeDialog(); |
271 void OpenFile(); | 287 void OpenFile(); |
272 void OpenTaskManager(); | 288 void OpenTaskManager(); |
273 void OpenOptionsDialog(); | 289 void OpenOptionsDialog(); |
274 void OpenHelpTab(); | 290 void OpenHelpTab(); |
275 void ShowHistoryTab(); | 291 void ShowHistoryTab(); |
276 void ShowDownloadsTab(); | 292 void ShowDownloadsTab(); |
277 void OpenBookmarksManager(); | 293 void OpenBookmarksManager(); |
278 void ToggleBookmarksBar(); | 294 void ToggleBookmarksBar(); |
| 295 void OpenSelectProfileDialog(); |
| 296 void OpenNewProfileDialog(); |
279 | 297 |
280 ///////////////////////////////////////////////////////////////////////////// | 298 ///////////////////////////////////////////////////////////////////////////// |
281 | 299 |
282 static void RegisterPrefs(PrefService* prefs); | 300 static void RegisterPrefs(PrefService* prefs); |
283 static void RegisterUserPrefs(PrefService* prefs); | 301 static void RegisterUserPrefs(PrefService* prefs); |
284 | 302 |
285 // Returns the Browser which contains the tab with the given | 303 // Returns the Browser which contains the tab with the given |
286 // NavigationController, also filling in |index| (if valid) with the tab's | 304 // NavigationController, also filling in |index| (if valid) with the tab's |
287 // index in the tab strip. | 305 // index in the tab strip. |
288 // Returns NULL if not found. | 306 // Returns NULL if not found. |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // The browser idle task helps cleanup unused memory resources when idle. | 616 // The browser idle task helps cleanup unused memory resources when idle. |
599 scoped_ptr<BrowserIdleTimer> idle_task_; | 617 scoped_ptr<BrowserIdleTimer> idle_task_; |
600 | 618 |
601 // Keep track of the encoding auto detect pref. | 619 // Keep track of the encoding auto detect pref. |
602 BooleanPrefMember encoding_auto_detect_; | 620 BooleanPrefMember encoding_auto_detect_; |
603 | 621 |
604 DISALLOW_COPY_AND_ASSIGN(Browser); | 622 DISALLOW_COPY_AND_ASSIGN(Browser); |
605 }; | 623 }; |
606 | 624 |
607 #endif // CHROME_BROWSER_BROWSER_H_ | 625 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |