| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 // - The "suppress_default_browser_prompt_for_version" master preference is | 301 // - The "suppress_default_browser_prompt_for_version" master preference is |
| 302 // set to the current version. | 302 // set to the current version. |
| 303 bool show_prompt = | 303 bool show_prompt = |
| 304 profile->GetPrefs()->GetBoolean(prefs::kCheckDefaultBrowser); | 304 profile->GetPrefs()->GetBoolean(prefs::kCheckDefaultBrowser); |
| 305 if (show_prompt) { | 305 if (show_prompt) { |
| 306 const std::string disable_version_string = | 306 const std::string disable_version_string = |
| 307 g_browser_process->local_state()->GetString( | 307 g_browser_process->local_state()->GetString( |
| 308 prefs::kBrowserSuppressDefaultBrowserPrompt); | 308 prefs::kBrowserSuppressDefaultBrowserPrompt); |
| 309 const Version disable_version(disable_version_string); | 309 const Version disable_version(disable_version_string); |
| 310 DCHECK(disable_version_string.empty() || disable_version.IsValid()); | 310 DCHECK(disable_version_string.empty() || disable_version.IsValid()); |
| 311 if (disable_version.IsValid()) { | 311 if (disable_version.IsValid() && |
| 312 if (disable_version.Equals(Version(version_info::GetVersionNumber()))) | 312 disable_version == Version(version_info::GetVersionNumber())) { |
| 313 show_prompt = false; | 313 show_prompt = false; |
| 314 } | 314 } |
| 315 } | 315 } |
| 316 | 316 |
| 317 scoped_refptr<ShellIntegration::DefaultBrowserWorker>( | 317 scoped_refptr<ShellIntegration::DefaultBrowserWorker>( |
| 318 new ShellIntegration::DefaultBrowserWorker( | 318 new ShellIntegration::DefaultBrowserWorker( |
| 319 new CheckDefaultBrowserObserver(profile->GetPath(), show_prompt, | 319 new CheckDefaultBrowserObserver(profile->GetPath(), show_prompt, |
| 320 desktop_type))) | 320 desktop_type))) |
| 321 ->StartCheckIsDefault(); | 321 ->StartCheckIsDefault(); |
| 322 } | 322 } |
| 323 | 323 |
| 324 #if !defined(OS_WIN) | 324 #if !defined(OS_WIN) |
| 325 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 325 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
| 326 return false; | 326 return false; |
| 327 } | 327 } |
| 328 #endif | 328 #endif |
| 329 | 329 |
| 330 } // namespace chrome | 330 } // namespace chrome |
| OLD | NEW |