| 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 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace base { | 22 namespace base { |
| 23 class CommandLine; | 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 internals { | 31 namespace internals { |
| 32 GURL GetResetSettingsURL(); |
| 32 GURL GetWelcomePageURL(); | 33 GURL GetWelcomePageURL(); |
| 33 } // namespace internals | 34 } // namespace internals |
| 34 | 35 |
| 35 // Assists launching the application and appending the initial tabs for a | 36 // Assists launching the application and appending the initial tabs for a |
| 36 // browser window. | 37 // browser window. |
| 37 class StartupBrowserCreatorImpl { | 38 class StartupBrowserCreatorImpl { |
| 38 public: | 39 public: |
| 39 // There are two ctors. The first one implies a NULL browser_creator object | 40 // There are two ctors. The first one implies a NULL browser_creator object |
| 40 // and thus no access to distribution-specific first-run behaviors. The | 41 // and thus no access to distribution-specific first-run behaviors. The |
| 41 // second one is always called when the browser starts even if it is not | 42 // second one is always called when the browser starts even if it is not |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs); | 139 void AddUniqueURLs(const std::vector<GURL>& urls, StartupTabs* tabs); |
| 139 | 140 |
| 140 // Adds any startup infobars to the selected tab of the given browser. | 141 // Adds any startup infobars to the selected tab of the given browser. |
| 141 void AddInfoBarsIfNecessary( | 142 void AddInfoBarsIfNecessary( |
| 142 Browser* browser, | 143 Browser* browser, |
| 143 chrome::startup::IsProcessStartup is_process_startup); | 144 chrome::startup::IsProcessStartup is_process_startup); |
| 144 | 145 |
| 145 // Adds additional startup URLs to the specified vector. | 146 // Adds additional startup URLs to the specified vector. |
| 146 void AddStartupURLs(std::vector<GURL>* startup_urls) const; | 147 void AddStartupURLs(std::vector<GURL>* startup_urls) const; |
| 147 | 148 |
| 149 // Adds special URLs to the specified vector. These URLs are triggered by |
| 150 // special-case logic, such as profile reset or presentation of the welcome |
| 151 // page. |
| 152 void AddSpecialURLs(std::vector<GURL>* startup_urls) const; |
| 153 |
| 148 // Initializes |welcome_run_type_| for this launch. Also persists state to | 154 // Initializes |welcome_run_type_| for this launch. Also persists state to |
| 149 // suppress injecting the welcome page for future launches. | 155 // suppress injecting the welcome page for future launches. |
| 150 void InitializeWelcomeRunType(const std::vector<GURL>& urls_to_open); | 156 void InitializeWelcomeRunType(const std::vector<GURL>& urls_to_open); |
| 151 | 157 |
| 152 // Record Rappor metrics on startup URLs. | 158 // Record Rappor metrics on startup URLs. |
| 153 void RecordRapporOnStartupURLs(const std::vector<GURL>& urls_to_open); | 159 void RecordRapporOnStartupURLs(const std::vector<GURL>& urls_to_open); |
| 154 | 160 |
| 161 // Checks whether |profile_| has a reset trigger set and then clears the |
| 162 // reset trigger. |
| 163 bool CheckAndClearProfileResetTrigger() const; |
| 164 |
| 155 const base::FilePath cur_dir_; | 165 const base::FilePath cur_dir_; |
| 156 const base::CommandLine& command_line_; | 166 const base::CommandLine& command_line_; |
| 157 Profile* profile_; | 167 Profile* profile_; |
| 158 StartupBrowserCreator* browser_creator_; | 168 StartupBrowserCreator* browser_creator_; |
| 159 bool is_first_run_; | 169 bool is_first_run_; |
| 160 WelcomeRunType welcome_run_type_; | 170 WelcomeRunType welcome_run_type_; |
| 161 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); | 171 DISALLOW_COPY_AND_ASSIGN(StartupBrowserCreatorImpl); |
| 162 }; | 172 }; |
| 163 | 173 |
| 164 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ | 174 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_IMPL_H_ |
| OLD | NEW |