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_H_ | 5 #ifndef CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 6 #define CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "chrome/browser/prefs/session_startup_pref.h" | 14 #include "chrome/browser/prefs/session_startup_pref.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/ui/startup/startup_tab.h" | 16 #include "chrome/browser/ui/startup/startup_tab.h" |
17 #include "chrome/browser/ui/startup/startup_types.h" | 17 #include "chrome/browser/ui/startup/startup_types.h" |
18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
19 | 19 |
20 class Browser; | 20 class Browser; |
21 class GURL; | 21 class GURL; |
| 22 class PrefRegistrySimple; |
22 class PrefService; | 23 class PrefService; |
23 | 24 |
24 namespace base { | 25 namespace base { |
25 class CommandLine; | 26 class CommandLine; |
26 } | 27 } |
27 | 28 |
28 // class containing helpers for BrowserMain to spin up a new instance and | 29 // class containing helpers for BrowserMain to spin up a new instance and |
29 // initialize the profile. | 30 // initialize the profile. |
30 class StartupBrowserCreator { | 31 class StartupBrowserCreator { |
31 public: | 32 public: |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 show_main_browser_window_ = show_main_browser_window; | 94 show_main_browser_window_ = show_main_browser_window; |
94 } | 95 } |
95 | 96 |
96 bool show_main_browser_window() const { | 97 bool show_main_browser_window() const { |
97 return show_main_browser_window_; | 98 return show_main_browser_window_; |
98 } | 99 } |
99 | 100 |
100 // For faking that no profiles have been launched yet. | 101 // For faking that no profiles have been launched yet. |
101 static void ClearLaunchedProfilesForTesting(); | 102 static void ClearLaunchedProfilesForTesting(); |
102 | 103 |
| 104 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); |
| 105 |
103 private: | 106 private: |
104 friend class CloudPrintProxyPolicyTest; | 107 friend class CloudPrintProxyPolicyTest; |
105 friend class CloudPrintProxyPolicyStartupTest; | 108 friend class CloudPrintProxyPolicyStartupTest; |
106 friend class StartupBrowserCreatorImpl; | 109 friend class StartupBrowserCreatorImpl; |
107 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 110 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
108 ReadingWasRestartedAfterNormalStart); | 111 ReadingWasRestartedAfterNormalStart); |
109 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
110 ReadingWasRestartedAfterRestart); | 113 ReadingWasRestartedAfterRestart); |
111 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); | 114 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); |
112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); | 115 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Returns true if |profile| has exited uncleanly and has not been launched | 174 // Returns true if |profile| has exited uncleanly and has not been launched |
172 // after the unclean exit. | 175 // after the unclean exit. |
173 bool HasPendingUncleanExit(Profile* profile); | 176 bool HasPendingUncleanExit(Profile* profile); |
174 | 177 |
175 // Returns the path that contains the profile that should be loaded on process | 178 // Returns the path that contains the profile that should be loaded on process |
176 // startup. | 179 // startup. |
177 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 180 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, |
178 const base::CommandLine& command_line); | 181 const base::CommandLine& command_line); |
179 | 182 |
180 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 183 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
OLD | NEW |