| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Assists launching the application and appending the initial tabs for a | 28 // Assists launching the application and appending the initial tabs for a |
| 29 // browser window. | 29 // browser window. |
| 30 class StartupBrowserCreatorImpl { | 30 class StartupBrowserCreatorImpl { |
| 31 public: | 31 public: |
| 32 // There are two ctors. The first one implies a NULL browser_creator object | 32 // There are two ctors. The first one implies a NULL browser_creator object |
| 33 // and thus no access to distribution-specific first-run behaviors. The | 33 // and thus no access to distribution-specific first-run behaviors. The |
| 34 // second one is always called when the browser starts even if it is not | 34 // second one is always called when the browser starts even if it is not |
| 35 // the first run. |is_first_run| indicates that this is a new profile. | 35 // the first run. |is_first_run| indicates that this is a new profile. |
| 36 StartupBrowserCreatorImpl(const FilePath& cur_dir, | 36 StartupBrowserCreatorImpl(const FilePath& cur_dir, |
| 37 const CommandLine& command_line, | 37 const CommandLine& command_line, |
| 38 browser::startup::IsFirstRun is_first_run); | 38 chrome::startup::IsFirstRun is_first_run); |
| 39 StartupBrowserCreatorImpl(const FilePath& cur_dir, | 39 StartupBrowserCreatorImpl(const FilePath& cur_dir, |
| 40 const CommandLine& command_line, | 40 const CommandLine& command_line, |
| 41 StartupBrowserCreator* browser_creator, | 41 StartupBrowserCreator* browser_creator, |
| 42 browser::startup::IsFirstRun is_first_run); | 42 chrome::startup::IsFirstRun is_first_run); |
| 43 ~StartupBrowserCreatorImpl(); | 43 ~StartupBrowserCreatorImpl(); |
| 44 | 44 |
| 45 // Creates the necessary windows for startup. Returns true on success, | 45 // Creates the necessary windows for startup. Returns true on success, |
| 46 // false on failure. process_startup is true if Chrome is just | 46 // false on failure. process_startup is true if Chrome is just |
| 47 // starting up. If process_startup is false, it indicates Chrome was | 47 // starting up. If process_startup is false, it indicates Chrome was |
| 48 // already running and the user wants to launch another instance. | 48 // already running and the user wants to launch another instance. |
| 49 bool Launch(Profile* profile, | 49 bool Launch(Profile* profile, |
| 50 const std::vector<GURL>& urls_to_open, | 50 const std::vector<GURL>& urls_to_open, |
| 51 bool process_startup); | 51 bool process_startup); |
| 52 | 52 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Otherwise null is returned and the caller must create a new browser. | 116 // Otherwise null is returned and the caller must create a new browser. |
| 117 Browser* ProcessSpecifiedURLs(const std::vector<GURL>& urls_to_open); | 117 Browser* ProcessSpecifiedURLs(const std::vector<GURL>& urls_to_open); |
| 118 | 118 |
| 119 // Adds a Tab to |tabs| for each url in |urls| that doesn't already exist | 119 // Adds a Tab to |tabs| for each url in |urls| that doesn't already exist |
| 120 // in |tabs|. | 120 // in |tabs|. |
| 121 void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs); | 121 void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs); |
| 122 | 122 |
| 123 // Adds any startup infobars to the selected tab of the given browser. | 123 // Adds any startup infobars to the selected tab of the given browser. |
| 124 void AddInfoBarsIfNecessary( | 124 void AddInfoBarsIfNecessary( |
| 125 Browser* browser, | 125 Browser* browser, |
| 126 browser::startup::IsProcessStartup is_process_startup); | 126 chrome::startup::IsProcessStartup is_process_startup); |
| 127 | 127 |
| 128 // Adds additional startup URLs to the specified vector. | 128 // Adds additional startup URLs to the specified vector. |
| 129 void AddStartupURLs(std::vector<GURL>* startup_urls) const; | 129 void AddStartupURLs(std::vector<GURL>* startup_urls) const; |
| 130 | 130 |
| 131 // Checks whether the Preferences backup is invalid and notifies user in | 131 // Checks whether the Preferences backup is invalid and notifies user in |
| 132 // that case. | 132 // that case. |
| 133 void CheckPreferencesBackup(Profile* profile); | 133 void CheckPreferencesBackup(Profile* profile); |
| 134 | 134 |
| 135 const FilePath cur_dir_; | 135 const FilePath cur_dir_; |
| 136 const CommandLine& command_line_; | 136 const CommandLine& command_line_; |
| 137 Profile* profile_; | 137 Profile* profile_; |
| 138 StartupBrowserCreator* browser_creator_; | 138 StartupBrowserCreator* browser_creator_; |
| 139 bool is_first_run_; | 139 bool is_first_run_; |
| 140 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); | 140 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 // Returns true if |profile| has exited uncleanly and has not been launched | 143 // Returns true if |profile| has exited uncleanly and has not been launched |
| 144 // after the unclean exit. | 144 // after the unclean exit. |
| 145 bool HasPendingUncleanExit(Profile* profile); | 145 bool HasPendingUncleanExit(Profile* profile); |
| 146 | 146 |
| 147 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 147 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
| OLD | NEW |