Chromium Code Reviews| 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 <map> | |
|
grt (UTC plus 2)
2015/09/24 18:24:12
unused
Patrick Monette
2015/09/25 20:06:25
Removed.
| |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 14 #include "chrome/browser/prefs/session_startup_pref.h" | 15 #include "chrome/browser/prefs/session_startup_pref.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/startup/startup_tab.h" | 17 #include "chrome/browser/ui/startup/startup_tab.h" |
| 17 #include "chrome/browser/ui/startup/startup_types.h" | 18 #include "chrome/browser/ui/startup/startup_types.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 | 97 |
| 97 bool show_main_browser_window() const { | 98 bool show_main_browser_window() const { |
| 98 return show_main_browser_window_; | 99 return show_main_browser_window_; |
| 99 } | 100 } |
| 100 | 101 |
| 101 // For faking that no profiles have been launched yet. | 102 // For faking that no profiles have been launched yet. |
| 102 static void ClearLaunchedProfilesForTesting(); | 103 static void ClearLaunchedProfilesForTesting(); |
| 103 | 104 |
| 104 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); | 105 static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); |
| 105 | 106 |
| 107 #if defined(OS_WIN) | |
| 108 // Setting Chrome as the default browser in Windows 10+ requires a specific | |
| 109 // url to be opened through openwith.exe. We intercept this url in | |
| 110 // ProcessCmdLineImpl when the interceptor is set. See DefaultBrowserWorker in | |
| 111 // shell_integration.h for more details. | |
| 112 static void SetAsyncSetAsDefaultFilter(base::Closure callback); | |
|
Peter Kasting
2015/09/23 23:01:39
I find the consistent use of the phrase "AsyncSetA
grt (UTC plus 2)
2015/09/24 18:24:12
nit: pass callbacks by constref
Patrick Monette
2015/09/25 20:06:25
Done.
Patrick Monette
2015/09/25 20:06:25
Done.
| |
| 113 | |
| 114 // Clears the filter when it isn't needed anymore. | |
| 115 static void ClearAsyncSetAsDefaultFilter(); | |
| 116 | |
| 117 // Returns the url used to set Chrome as the default browser asynchronously. | |
| 118 static const wchar_t* GetAsyncSetAsDefaultUrl(); | |
| 119 #endif // defined(OS_WIN) | |
| 120 | |
| 121 // All the filters functions should be called on the UI thread. | |
|
Peter Kasting
2015/09/23 23:01:39
Looks like all this should have been removed?
Patrick Monette
2015/09/25 20:06:25
Yes. Removed.
| |
| 122 /* | |
| 123 // Adds a new filter that will execute the |callback| when the |url| is opened | |
| 124 // through the command line. | |
| 125 static void AddUrlFilter(const GURL& url, | |
| 126 const base::Callback<void(void)>& callback); | |
| 127 | |
| 128 // Removes the filter associated the the |url|. | |
| 129 static void RemoveUrlFilter(const GURL& url); | |
| 130 | |
| 131 // Returns true if at least one url filter exists. | |
| 132 static bool HasUrlFilters(); | |
| 133 | |
| 134 // Executes the callback associated to the |url| filter. Returns false if the | |
| 135 // |url| isn't associated to any filters. | |
| 136 static bool ExecuteFilterCallback(const GURL& url); | |
| 137 | |
| 138 // Returns true if a filter is associated to the |url|. | |
| 139 static bool UrlFilterExists(const GURL& url);*/ | |
| 140 | |
| 106 private: | 141 private: |
| 107 friend class CloudPrintProxyPolicyTest; | 142 friend class CloudPrintProxyPolicyTest; |
| 108 friend class CloudPrintProxyPolicyStartupTest; | 143 friend class CloudPrintProxyPolicyStartupTest; |
| 109 friend class StartupBrowserCreatorImpl; | 144 friend class StartupBrowserCreatorImpl; |
| 110 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 145 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
| 111 ReadingWasRestartedAfterNormalStart); | 146 ReadingWasRestartedAfterNormalStart); |
| 112 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, | 147 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, |
| 113 ReadingWasRestartedAfterRestart); | 148 ReadingWasRestartedAfterRestart); |
| 114 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); | 149 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, UpdateWithTwoProfiles); |
| 115 FRIEND_TEST_ALL_PREFIXES(StartupBrowserCreatorTest, LastUsedProfileActivated); | 150 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 | 209 // Returns true if |profile| has exited uncleanly and has not been launched |
| 175 // after the unclean exit. | 210 // after the unclean exit. |
| 176 bool HasPendingUncleanExit(Profile* profile); | 211 bool HasPendingUncleanExit(Profile* profile); |
| 177 | 212 |
| 178 // Returns the path that contains the profile that should be loaded on process | 213 // Returns the path that contains the profile that should be loaded on process |
| 179 // startup. | 214 // startup. |
| 180 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, | 215 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, |
| 181 const base::CommandLine& command_line); | 216 const base::CommandLine& command_line); |
| 182 | 217 |
| 183 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ | 218 #endif // CHROME_BROWSER_UI_STARTUP_STARTUP_BROWSER_CREATOR_H_ |
| OLD | NEW |