| 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 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 5 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 void OnCheckIsDefaultBrowserFinished( | 224 void OnCheckIsDefaultBrowserFinished( |
| 225 const base::FilePath& profile_path, | 225 const base::FilePath& profile_path, |
| 226 bool show_prompt, | 226 bool show_prompt, |
| 227 shell_integration::DefaultWebClientState state) { | 227 shell_integration::DefaultWebClientState state) { |
| 228 if (state == shell_integration::IS_DEFAULT) { | 228 if (state == shell_integration::IS_DEFAULT) { |
| 229 // Notify the user in the future if Chrome ceases to be the user's chosen | 229 // Notify the user in the future if Chrome ceases to be the user's chosen |
| 230 // default browser. | 230 // default browser. |
| 231 ResetCheckDefaultBrowserPref(profile_path); | 231 ResetCheckDefaultBrowserPref(profile_path); |
| 232 } else if (show_prompt && state == shell_integration::NOT_DEFAULT && | 232 } else if (show_prompt && state == shell_integration::NOT_DEFAULT && |
| 233 shell_integration::CanSetAsDefaultBrowser() != | 233 shell_integration::CanSetAsDefaultBrowser()) { |
| 234 shell_integration::SET_DEFAULT_NOT_ALLOWED) { | |
| 235 ShowPrompt(); | 234 ShowPrompt(); |
| 236 } | 235 } |
| 237 } | 236 } |
| 238 | 237 |
| 239 } // namespace | 238 } // namespace |
| 240 | 239 |
| 241 namespace chrome { | 240 namespace chrome { |
| 242 | 241 |
| 243 void RegisterDefaultBrowserPromptPrefs(PrefRegistrySimple* registry) { | 242 void RegisterDefaultBrowserPromptPrefs(PrefRegistrySimple* registry) { |
| 244 registry->RegisterStringPref( | 243 registry->RegisterStringPref( |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 profile->GetPrefs()->ClearPref(prefs::kCheckDefaultBrowser); | 292 profile->GetPrefs()->ClearPref(prefs::kCheckDefaultBrowser); |
| 294 } | 293 } |
| 295 | 294 |
| 296 #if !defined(OS_WIN) | 295 #if !defined(OS_WIN) |
| 297 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 296 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
| 298 return false; | 297 return false; |
| 299 } | 298 } |
| 300 #endif | 299 #endif |
| 301 | 300 |
| 302 } // namespace chrome | 301 } // namespace chrome |
| OLD | NEW |