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 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 bool show_main_browser_window() const { | 97 bool show_main_browser_window() const { |
98 return show_main_browser_window_; | 98 return show_main_browser_window_; |
99 } | 99 } |
100 | 100 |
101 // For faking that no profiles have been launched yet. | 101 // For faking that no profiles have been launched yet. |
102 static void ClearLaunchedProfilesForTesting(); | 102 static void ClearLaunchedProfilesForTesting(); |
103 | 103 |
104 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); | 104 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); |
105 | 105 |
| 106 #if defined(OS_WIN) |
| 107 // Setting Chrome as the default browser in Windows 10+ requires a specific |
| 108 // url to be opened through openwith.exe. This url is intercepted in |
| 109 // ProcessCmdLineImpl when the callback is set. See DefaultBrowserWorker in |
| 110 // shell_integration.h for more details. Only call this on the UI |
| 111 // thread. |
| 112 // |
| 113 // Returns false when the default browser callback was already set which |
| 114 // results in a no-op. |
| 115 static bool SetDefaultBrowserCallback(const base::Closure& callback); |
| 116 |
| 117 // Clears the callback when it isn't needed anymore. Only call this on the UI |
| 118 // thread. |
| 119 static void ClearDefaultBrowserCallback(); |
| 120 |
| 121 // Returns the url used to set Chrome as the default browser asynchronously. |
| 122 static const wchar_t* GetDefaultBrowserUrl(); |
| 123 #endif // defined(OS_WIN) |
| 124 |
106 private: | 125 private: |
107 friend class CloudPrintProxyPolicyTest; | 126 friend class CloudPrintProxyPolicyTest; |
108 friend class CloudPrintProxyPolicyStartupTest; | 127 friend class CloudPrintProxyPolicyStartupTest; |
109 friend class StartupBrowserCreatorImpl; | 128 friend class StartupBrowserCreatorImpl; |
110 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 129 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
111 ReadingWasRestartedAfterNormalStart); | 130 ReadingWasRestartedAfterNormalStart); |
112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 131 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
113 ReadingWasRestartedAfterRestart); | 132 ReadingWasRestartedAfterRestart); |
114 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); | 133 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); |
115 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); | 134 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Returns true if |profile| has exited uncleanly and has not been launched | 193 // Returns true if |profile| has exited uncleanly and has not been launched |
175 // after the unclean exit. | 194 // after the unclean exit. |
176 bool HasPendingUncleanExit(Profile* profile); | 195 bool HasPendingUncleanExit(Profile* profile); |
177 | 196 |
178 // Returns the path that contains the profile that should be loaded on process | 197 // Returns the path that contains the profile that should be loaded on process |
179 // startup. | 198 // startup. |
180 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 199 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, |
181 const base::CommandLine& command_line); | 200 const base::CommandLine& command_line); |
182 | 201 |
183 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 202 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
OLD | NEW |