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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/importer/importer_progress_dialog.h" | 22 #include "chrome/browser/importer/importer_progress_dialog.h" |
23 #include "chrome/browser/importer/importer_progress_observer.h" | 23 #include "chrome/browser/importer/importer_progress_observer.h" |
24 #include "chrome/browser/prefs/pref_service.h" | 24 #include "chrome/browser/prefs/pref_service.h" |
25 #include "chrome/browser/process_singleton.h" | 25 #include "chrome/browser/process_singleton.h" |
26 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
27 #include "chrome/browser/search_engines/template_url_service.h" | 27 #include "chrome/browser/search_engines/template_url_service.h" |
28 #include "chrome/browser/search_engines/template_url_service_factory.h" | 28 #include "chrome/browser/search_engines/template_url_service_factory.h" |
29 #include "chrome/browser/shell_integration.h" | 29 #include "chrome/browser/shell_integration.h" |
30 #include "chrome/browser/ui/browser.h" | 30 #include "chrome/browser/ui/browser.h" |
31 #include "chrome/browser/ui/browser_finder.h" | 31 #include "chrome/browser/ui/browser_finder.h" |
| 32 #include "chrome/browser/ui/browser_tabstrip.h" |
32 #include "chrome/browser/ui/global_error/global_error_service.h" | 33 #include "chrome/browser/ui/global_error/global_error_service.h" |
33 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 34 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
34 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 35 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
35 #include "chrome/common/chrome_paths.h" | 36 #include "chrome/common/chrome_paths.h" |
36 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/common/pref_names.h" | 38 #include "chrome/common/pref_names.h" |
38 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
39 #include "chrome/installer/util/master_preferences.h" | 40 #include "chrome/installer/util/master_preferences.h" |
40 #include "chrome/installer/util/master_preferences_constants.h" | 41 #include "chrome/installer/util/master_preferences_constants.h" |
41 #include "chrome/installer/util/util_constants.h" | 42 #include "chrome/installer/util/util_constants.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 if (!browser || !browser->is_type_tabbed()) | 507 if (!browser || !browser->is_type_tabbed()) |
507 return; | 508 return; |
508 | 509 |
509 // Check the preference to determine if the bubble should be shown. | 510 // Check the preference to determine if the bubble should be shown. |
510 PrefService* prefs = g_browser_process->local_state(); | 511 PrefService* prefs = g_browser_process->local_state(); |
511 if (!prefs || !prefs->GetBoolean(prefs::kShouldShowFirstRunBubble)) { | 512 if (!prefs || !prefs->GetBoolean(prefs::kShouldShowFirstRunBubble)) { |
512 delete this; | 513 delete this; |
513 return; | 514 return; |
514 } | 515 } |
515 | 516 |
516 content::WebContents* contents = browser->GetActiveWebContents(); | 517 content::WebContents* contents = chrome::GetActiveWebContents(browser); |
517 if (contents && contents->GetURL().SchemeIs(chrome::kChromeUIScheme)) { | 518 if (contents && contents->GetURL().SchemeIs(chrome::kChromeUIScheme)) { |
518 // Suppress the first run bubble if the sync promo is showing. | 519 // Suppress the first run bubble if the sync promo is showing. |
519 if (contents->GetURL().host() == chrome::kChromeUISyncPromoHost) | 520 if (contents->GetURL().host() == chrome::kChromeUISyncPromoHost) |
520 return; | 521 return; |
521 | 522 |
522 // Suppress the first run bubble if 'make chrome metro' flow is showing. | 523 // Suppress the first run bubble if 'make chrome metro' flow is showing. |
523 if (contents->GetURL().host() == chrome::kChromeUIMetroFlowHost) | 524 if (contents->GetURL().host() == chrome::kChromeUIMetroFlowHost) |
524 return; | 525 return; |
525 | 526 |
526 // Suppress the first run bubble if the NTP sync promo bubble is showing. | 527 // Suppress the first run bubble if the NTP sync promo bubble is showing. |
(...skipping 13 matching lines...) Expand all Loading... |
540 | 541 |
541 // Reset the preference and notifications to avoid showing the bubble again. | 542 // Reset the preference and notifications to avoid showing the bubble again. |
542 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 543 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
543 | 544 |
544 // Show the bubble now and destroy this bubble launcher. | 545 // Show the bubble now and destroy this bubble launcher. |
545 browser->ShowFirstRunBubble(); | 546 browser->ShowFirstRunBubble(); |
546 delete this; | 547 delete this; |
547 } | 548 } |
548 | 549 |
549 } // namespace first_run | 550 } // namespace first_run |
OLD | NEW |