OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
14 #include "base/task.h" | 14 #include "base/task.h" |
15 #include "chrome/browser/command_updater.h" | 15 #include "chrome/browser/command_updater.h" |
16 #include "chrome/browser/pref_member.h" | 16 #include "chrome/browser/pref_member.h" |
17 #include "chrome/browser/sessions/session_id.h" | 17 #include "chrome/browser/sessions/session_id.h" |
18 #include "chrome/browser/shell_dialogs.h" | 18 #include "chrome/browser/shell_dialogs.h" |
19 #include "chrome/browser/tabs/tab_strip_model.h" | 19 #include "chrome/browser/tabs/tab_strip_model.h" |
20 #include "chrome/browser/tab_contents/page_navigator.h" | 20 #include "chrome/browser/tab_contents/page_navigator.h" |
21 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 21 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
22 #include "chrome/browser/toolbar_model.h" | 22 #include "chrome/browser/toolbar_model.h" |
| 23 #include "chrome/common/extensions/extension.h" |
23 #include "chrome/common/notification_registrar.h" | 24 #include "chrome/common/notification_registrar.h" |
24 #include "chrome/common/page_zoom.h" | 25 #include "chrome/common/page_zoom.h" |
25 #include "gfx/rect.h" | 26 #include "gfx/rect.h" |
26 #include "testing/gtest/include/gtest/gtest_prod.h" | 27 #include "testing/gtest/include/gtest/gtest_prod.h" |
27 | 28 |
28 class BrowserWindow; | 29 class BrowserWindow; |
29 class DebuggerWindow; | 30 class DebuggerWindow; |
30 class Extension; | 31 class Extension; |
31 class ExtensionShelfModel; | 32 class ExtensionShelfModel; |
32 class FindBarController; | 33 class FindBarController; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 202 |
202 // Opens a new window with the tabs from |profile|'s TabRestoreService. | 203 // Opens a new window with the tabs from |profile|'s TabRestoreService. |
203 static void OpenWindowWithRestoredTabs(Profile* profile); | 204 static void OpenWindowWithRestoredTabs(Profile* profile); |
204 | 205 |
205 // Opens the specified URL in a new browser window in an incognito session. | 206 // Opens the specified URL in a new browser window in an incognito session. |
206 // If there is already an existing active incognito session for the specified | 207 // If there is already an existing active incognito session for the specified |
207 // |profile|, that session is re-used. | 208 // |profile|, that session is re-used. |
208 static void OpenURLOffTheRecord(Profile* profile, const GURL& url); | 209 static void OpenURLOffTheRecord(Profile* profile, const GURL& url); |
209 | 210 |
210 // Open an application specified by |app_id| in the appropriate launch | 211 // Open an application specified by |app_id| in the appropriate launch |
211 // container. Returns false if the app_id is invalid or if ExtensionsService | 212 // container. Returns NULL if the app_id is invalid or if ExtensionsService |
212 // isn't ready/available. | 213 // isn't ready/available. |
213 static bool OpenApplication(Profile* profile, const std::string& app_id); | 214 static TabContents* OpenApplication(Profile* profile, |
| 215 const std::string& app_id); |
| 216 |
| 217 // Open |extension| in |container|. Returns the TabContents* that was created |
| 218 // or NULL. |
| 219 static TabContents* OpenApplication(Profile* profile, |
| 220 Extension* extension, |
| 221 Extension::LaunchContainer container); |
214 | 222 |
215 // Opens a new application window for the specified url. If |as_panel| | 223 // Opens a new application window for the specified url. If |as_panel| |
216 // is true, the application will be opened as a Browser::Type::APP_PANEL in | 224 // is true, the application will be opened as a Browser::Type::APP_PANEL in |
217 // app panel window, otherwise it will be opened as as either | 225 // app panel window, otherwise it will be opened as as either |
218 // Browser::Type::APP a.k.a. "thin frame" (if |extension| is NULL) or | 226 // Browser::Type::APP a.k.a. "thin frame" (if |extension| is NULL) or |
219 // Browser::Type::EXTENSION_APP (if |extension| is non-NULL). | 227 // Browser::Type::EXTENSION_APP (if |extension| is non-NULL). |
220 static void OpenApplicationWindow(Profile* profile, Extension* extension, | 228 static TabContents* OpenApplicationWindow( |
221 const GURL& url, bool as_panel); | 229 Profile* profile, |
| 230 Extension* extension, |
| 231 Extension::LaunchContainer container, |
| 232 const GURL& url); |
222 | 233 |
223 // Open an application for |extension| in a new application window or panel. | 234 // Open an application for |extension| in a new application window or panel. |
224 static void OpenApplicationWindow(Profile* profile, Extension* extension); | 235 static TabContents* OpenApplicationWindow(Profile* profile, |
| 236 GURL& url); |
225 | 237 |
226 // Open an application for |extension| in a new application tab. Returns | 238 // Open an application for |extension| in a new application tab. Returns |
227 // false if there are no appropriate existing browser windows for |profile|. | 239 // NULL if there are no appropriate existing browser windows for |profile|. |
228 static bool OpenApplicationTab(Profile* profile, Extension* extension); | 240 static TabContents* OpenApplicationTab(Profile* profile, |
| 241 Extension* extension); |
229 | 242 |
230 // Opens a new window and opens the bookmark manager. | 243 // Opens a new window and opens the bookmark manager. |
231 static void OpenBookmarkManagerWindow(Profile* profile); | 244 static void OpenBookmarkManagerWindow(Profile* profile); |
232 | 245 |
233 #if defined(OS_MACOSX) | 246 #if defined(OS_MACOSX) |
234 // Open a new window with history/downloads/help (needed on Mac when there are | 247 // Open a new window with history/downloads/help (needed on Mac when there are |
235 // no windows). | 248 // no windows). |
236 static void OpenHistoryWindow(Profile* profile); | 249 static void OpenHistoryWindow(Profile* profile); |
237 static void OpenDownloadsWindow(Profile* profile); | 250 static void OpenDownloadsWindow(Profile* profile); |
238 static void OpenHelpWindow(Profile* profile); | 251 static void OpenHelpWindow(Profile* profile); |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 // from a TabContents. Currently, only one pending action is allowed. | 974 // from a TabContents. Currently, only one pending action is allowed. |
962 WebAppAction pending_web_app_action_; | 975 WebAppAction pending_web_app_action_; |
963 | 976 |
964 // The extension app associated with this window, if any. | 977 // The extension app associated with this window, if any. |
965 Extension* extension_app_; | 978 Extension* extension_app_; |
966 | 979 |
967 DISALLOW_COPY_AND_ASSIGN(Browser); | 980 DISALLOW_COPY_AND_ASSIGN(Browser); |
968 }; | 981 }; |
969 | 982 |
970 #endif // CHROME_BROWSER_BROWSER_H_ | 983 #endif // CHROME_BROWSER_BROWSER_H_ |
OLD | NEW |