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/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.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" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/version.h" | 12 #include "base/version.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/first_run/first_run.h" | 14 #include "chrome/browser/first_run/first_run.h" |
15 #include "chrome/browser/infobars/infobar_service.h" | 15 #include "chrome/browser/infobars/infobar_service.h" |
16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
17 #include "chrome/browser/shell_integration.h" | 17 #include "chrome/browser/shell_integration.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_finder.h" | 19 #include "chrome/browser/ui/browser_finder.h" |
20 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
21 #include "chrome/common/chrome_version_info.h" | 21 #include "chrome/common/chrome_version_info.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
| 23 #include "chrome/grit/chromium_strings.h" |
| 24 #include "chrome/grit/generated_resources.h" |
23 #include "chrome/installer/util/master_preferences.h" | 25 #include "chrome/installer/util/master_preferences.h" |
24 #include "chrome/installer/util/master_preferences_constants.h" | 26 #include "chrome/installer/util/master_preferences_constants.h" |
25 #include "components/infobars/core/confirm_infobar_delegate.h" | 27 #include "components/infobars/core/confirm_infobar_delegate.h" |
26 #include "components/infobars/core/infobar.h" | 28 #include "components/infobars/core/infobar.h" |
27 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
28 #include "content/public/browser/navigation_details.h" | 30 #include "content/public/browser/navigation_details.h" |
29 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
30 #include "grit/chromium_strings.h" | |
31 #include "grit/generated_resources.h" | |
32 #include "grit/theme_resources.h" | 32 #include "grit/theme_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
34 | 34 |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
38 // Calls the appropriate function for setting Chrome as the default browser. | 38 // Calls the appropriate function for setting Chrome as the default browser. |
39 // This requires IO access (registry) and may result in interaction with a | 39 // This requires IO access (registry) and may result in interaction with a |
40 // modal system UI. | 40 // modal system UI. |
41 void SetChromeAsDefaultBrowser(bool interactive_flow, PrefService* prefs) { | 41 void SetChromeAsDefaultBrowser(bool interactive_flow, PrefService* prefs) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 DCHECK(disable_version_string.empty() || disable_version.IsValid()); | 248 DCHECK(disable_version_string.empty() || disable_version.IsValid()); |
249 if (disable_version.IsValid()) { | 249 if (disable_version.IsValid()) { |
250 const chrome::VersionInfo version_info; | 250 const chrome::VersionInfo version_info; |
251 if (disable_version.Equals(Version(version_info.Version()))) | 251 if (disable_version.Equals(Version(version_info.Version()))) |
252 return; | 252 return; |
253 } | 253 } |
254 | 254 |
255 content::BrowserThread::PostTask( | 255 content::BrowserThread::PostTask( |
256 content::BrowserThread::FILE, FROM_HERE, | 256 content::BrowserThread::FILE, FROM_HERE, |
257 base::Bind(&CheckDefaultBrowserCallback, desktop_type)); | 257 base::Bind(&CheckDefaultBrowserCallback, desktop_type)); |
258 | |
259 } | 258 } |
260 | 259 |
261 #if !defined(OS_WIN) | 260 #if !defined(OS_WIN) |
262 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 261 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
263 return false; | 262 return false; |
264 } | 263 } |
265 #endif | 264 #endif |
266 | 265 |
267 } // namespace chrome | 266 } // namespace chrome |
OLD | NEW |