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