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 #if defined(OS_WIN) | |
msw
2015/07/09 17:51:30
Why not define this on all platforms and have an o
grt (UTC plus 2)
2015/07/09 18:59:37
No compelling reason. Done.
| |
105 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); | |
msw
2015/07/09 17:51:30
Why not add this to the impl class, where the pref
grt (UTC plus 2)
2015/07/09 18:59:37
Because I consider this .h to be the public facing
| |
106 #endif | |
107 | |
103 private: | 108 private: |
104 friend class CloudPrintProxyPolicyTest; | 109 friend class CloudPrintProxyPolicyTest; |
105 friend class CloudPrintProxyPolicyStartupTest; | 110 friend class CloudPrintProxyPolicyStartupTest; |
106 friend class StartupBrowserCreatorImpl; | 111 friend class StartupBrowserCreatorImpl; |
107 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
108 ReadingWasRestartedAfterNormalStart); | 113 ReadingWasRestartedAfterNormalStart); |
109 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 114 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
110 ReadingWasRestartedAfterRestart); | 115 ReadingWasRestartedAfterRestart); |
111 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); | 116 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); |
112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); | 117 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 | 176 // Returns true if |profile| has exited uncleanly and has not been launched |
172 // after the unclean exit. | 177 // after the unclean exit. |
173 bool HasPendingUncleanExit(Profile* profile); | 178 bool HasPendingUncleanExit(Profile* profile); |
174 | 179 |
175 // Returns the path that contains the profile that should be loaded on process | 180 // Returns the path that contains the profile that should be loaded on process |
176 // startup. | 181 // startup. |
177 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 182 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, |
178 const base::CommandLine& command_line); | 183 const base::CommandLine& command_line); |
179 | 184 |
180 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 185 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
OLD | NEW |