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 Version disable_version(disable_version_string); | 270 const base::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(Version(version_info::GetVersionNumber()))) | 273 if (disable_version.Equals( |
| 274 base::Version(version_info::GetVersionNumber()))) |
274 show_prompt = false; | 275 show_prompt = false; |
275 } | 276 } |
276 } | 277 } |
277 | 278 |
278 content::BrowserThread::PostTask( | 279 content::BrowserThread::PostTask( |
279 content::BrowserThread::FILE, FROM_HERE, | 280 content::BrowserThread::FILE, FROM_HERE, |
280 base::Bind(&CheckDefaultBrowserOnFileThread, profile->GetPath(), | 281 base::Bind(&CheckDefaultBrowserOnFileThread, profile->GetPath(), |
281 show_prompt, desktop_type)); | 282 show_prompt, desktop_type)); |
282 } | 283 } |
283 | 284 |
284 #if !defined(OS_WIN) | 285 #if !defined(OS_WIN) |
285 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 286 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
286 return false; | 287 return false; |
287 } | 288 } |
288 #endif | 289 #endif |
289 | 290 |
290 } // namespace chrome | 291 } // namespace chrome |
OLD | NEW |