Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(640)

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.h

Issue 1349163008: Setting chrome as the default browser is now fixed on Windows 10 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test for default browser callback + comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 thread.
111 static bool SetDefaultBrowserCallback(const base::Closure& callback);
grt (UTC plus 2) 2015/09/28 14:31:05 please document the return value.
Patrick Monette 2015/09/28 23:46:38 Done.
112
113 // Clears the callback when it isn't needed anymore. Only call this on the UI
114 // thread.
115 static void ClearDefaultBrowserCallback();
116
117 // Returns the url used to set Chrome as the default browser asynchronously.
118 static const wchar_t* GetDefaultBrowserUrl();
119 #endif // defined(OS_WIN)
120
106 private: 121 private:
107 friend class CloudPrintProxyPolicyTest; 122 friend class CloudPrintProxyPolicyTest;
108 friend class CloudPrintProxyPolicyStartupTest; 123 friend class CloudPrintProxyPolicyStartupTest;
109 friend class StartupBrowserCreatorImpl; 124 friend class StartupBrowserCreatorImpl;
110 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, 125 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest,
111 ReadingWasRestartedAfterNormalStart); 126 ReadingWasRestartedAfterNormalStart);
112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, 127 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest,
113 ReadingWasRestartedAfterRestart); 128 ReadingWasRestartedAfterRestart);
114 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); 129 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles);
115 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); 130 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Returns true if |profile| has exited uncleanly and has not been launched 189 // Returns true if |profile| has exited uncleanly and has not been launched
175 // after the unclean exit. 190 // after the unclean exit.
176 bool HasPendingUncleanExit(Profile* profile); 191 bool HasPendingUncleanExit(Profile* profile);
177 192
178 // Returns the path that contains the profile that should be loaded on process 193 // Returns the path that contains the profile that should be loaded on process
179 // startup. 194 // startup.
180 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, 195 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
181 const base::CommandLine& command_line); 196 const base::CommandLine& command_line);
182 197
183 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ 198 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698