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 "base/location.h" | 7 #include "base/location.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // TODO(pastarmovj): We can't really do anything meaningful here yet but | 260 // TODO(pastarmovj): We can't really do anything meaningful here yet but |
261 // just prevent showing the infobar. | 261 // just prevent showing the infobar. |
262 } | 262 } |
263 return; | 263 return; |
264 } | 264 } |
265 | 265 |
266 if (show_prompt) { | 266 if (show_prompt) { |
267 const std::string disable_version_string = | 267 const std::string disable_version_string = |
268 g_browser_process->local_state()->GetString( | 268 g_browser_process->local_state()->GetString( |
269 prefs::kBrowserSuppressDefaultBrowserPrompt); | 269 prefs::kBrowserSuppressDefaultBrowserPrompt); |
270 const base::Version disable_version(disable_version_string); | 270 const Version disable_version(disable_version_string); |
271 DCHECK(disable_version_string.empty() || disable_version.IsValid()); | 271 DCHECK(disable_version_string.empty() || disable_version.IsValid()); |
272 if (disable_version.IsValid()) { | 272 if (disable_version.IsValid()) { |
273 if (disable_version.Equals( | 273 if (disable_version.Equals(Version(version_info::GetVersionNumber()))) |
274 base::Version(version_info::GetVersionNumber()))) | |
275 show_prompt = false; | 274 show_prompt = false; |
276 } | 275 } |
277 } | 276 } |
278 | 277 |
279 content::BrowserThread::PostTask( | 278 content::BrowserThread::PostTask( |
280 content::BrowserThread::FILE, FROM_HERE, | 279 content::BrowserThread::FILE, FROM_HERE, |
281 base::Bind(&CheckDefaultBrowserOnFileThread, profile->GetPath(), | 280 base::Bind(&CheckDefaultBrowserOnFileThread, profile->GetPath(), |
282 show_prompt, desktop_type)); | 281 show_prompt, desktop_type)); |
283 } | 282 } |
284 | 283 |
285 #if !defined(OS_WIN) | 284 #if !defined(OS_WIN) |
286 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 285 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
287 return false; | 286 return false; |
288 } | 287 } |
289 #endif | 288 #endif |
290 | 289 |
291 } // namespace chrome | 290 } // namespace chrome |
OLD | NEW |