| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "chrome/browser/ui/host_desktop.h" | 13 #include "chrome/browser/ui/host_desktop.h" |
| 14 #include "chrome/browser/ui/startup/startup_tab.h" | 14 #include "chrome/browser/ui/startup/startup_tab.h" |
| 15 #include "chrome/browser/ui/startup/startup_types.h" | 15 #include "chrome/browser/ui/startup/startup_types.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 class Browser; | 18 class Browser; |
| 19 class CommandLine; | |
| 20 class Profile; | 19 class Profile; |
| 21 class StartupBrowserCreator; | 20 class StartupBrowserCreator; |
| 22 | 21 |
| 23 namespace base { | 22 namespace base { |
| 23 class CommandLine; |
| 24 class FilePath; | 24 class FilePath; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 class WebContents; | 28 class WebContents; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace gfx { | 31 namespace gfx { |
| 32 class Rect; | 32 class Rect; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace internals { | 35 namespace internals { |
| 36 GURL GetWelcomePageURL(); | 36 GURL GetWelcomePageURL(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 // Assists launching the application and appending the initial tabs for a | 39 // Assists launching the application and appending the initial tabs for a |
| 40 // browser window. | 40 // browser window. |
| 41 class StartupBrowserCreatorImpl { | 41 class StartupBrowserCreatorImpl { |
| 42 public: | 42 public: |
| 43 // There are two ctors. The first one implies a NULL browser_creator object | 43 // There are two ctors. The first one implies a NULL browser_creator object |
| 44 // and thus no access to distribution-specific first-run behaviors. The | 44 // and thus no access to distribution-specific first-run behaviors. The |
| 45 // second one is always called when the browser starts even if it is not | 45 // second one is always called when the browser starts even if it is not |
| 46 // the first run. |is_first_run| indicates that this is a new profile. | 46 // the first run. |is_first_run| indicates that this is a new profile. |
| 47 StartupBrowserCreatorImpl(const base::FilePath& cur_dir, | 47 StartupBrowserCreatorImpl(const base::FilePath& cur_dir, |
| 48 const CommandLine& command_line, | 48 const base::CommandLine& command_line, |
| 49 chrome::startup::IsFirstRun is_first_run); | 49 chrome::startup::IsFirstRun is_first_run); |
| 50 StartupBrowserCreatorImpl(const base::FilePath& cur_dir, | 50 StartupBrowserCreatorImpl(const base::FilePath& cur_dir, |
| 51 const CommandLine& command_line, | 51 const base::CommandLine& command_line, |
| 52 StartupBrowserCreator* browser_creator, | 52 StartupBrowserCreator* browser_creator, |
| 53 chrome::startup::IsFirstRun is_first_run); | 53 chrome::startup::IsFirstRun is_first_run); |
| 54 ~StartupBrowserCreatorImpl(); | 54 ~StartupBrowserCreatorImpl(); |
| 55 | 55 |
| 56 // Creates the necessary windows for startup. Returns true on success, | 56 // Creates the necessary windows for startup. Returns true on success, |
| 57 // false on failure. process_startup is true if Chrome is just | 57 // false on failure. process_startup is true if Chrome is just |
| 58 // starting up. If process_startup is false, it indicates Chrome was | 58 // starting up. If process_startup is false, it indicates Chrome was |
| 59 // already running and the user wants to launch another instance. | 59 // already running and the user wants to launch another instance. |
| 60 bool Launch(Profile* profile, | 60 bool Launch(Profile* profile, |
| 61 const std::vector<GURL>& urls_to_open, | 61 const std::vector<GURL>& urls_to_open, |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // that case. | 152 // that case. |
| 153 void CheckPreferencesBackup(Profile* profile); | 153 void CheckPreferencesBackup(Profile* profile); |
| 154 | 154 |
| 155 // Function to open startup urls in an existing Browser instance for the | 155 // Function to open startup urls in an existing Browser instance for the |
| 156 // profile passed in. Returns true on success. | 156 // profile passed in. Returns true on success. |
| 157 static bool OpenStartupURLsInExistingBrowser( | 157 static bool OpenStartupURLsInExistingBrowser( |
| 158 Profile* profile, | 158 Profile* profile, |
| 159 const std::vector<GURL>& startup_urls); | 159 const std::vector<GURL>& startup_urls); |
| 160 | 160 |
| 161 const base::FilePath cur_dir_; | 161 const base::FilePath cur_dir_; |
| 162 const CommandLine& command_line_; | 162 const base::CommandLine& command_line_; |
| 163 Profile* profile_; | 163 Profile* profile_; |
| 164 StartupBrowserCreator* browser_creator_; | 164 StartupBrowserCreator* browser_creator_; |
| 165 bool is_first_run_; | 165 bool is_first_run_; |
| 166 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); | 166 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 169 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
| OLD | NEW |