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/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 #include "ui/base/l10n/l10n_util.h" | 102 #include "ui/base/l10n/l10n_util.h" |
103 | 103 |
104 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
105 #include "base/mac/mac_util.h" | 105 #include "base/mac/mac_util.h" |
106 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 106 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
107 #endif | 107 #endif |
108 | 108 |
109 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
110 #include "base/win/windows_version.h" | 110 #include "base/win/windows_version.h" |
111 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" | 111 #include "chrome/browser/apps/app_launch_for_metro_restart_win.h" |
| 112 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 113 #include "components/search_engines/desktop_search_redirection_infobar_delegate.
h" |
| 114 #include "components/search_engines/template_url.h" |
| 115 #include "components/search_engines/template_url_service.h" |
112 #endif | 116 #endif |
113 | 117 |
114 #if defined(ENABLE_RLZ) | 118 #if defined(ENABLE_RLZ) |
115 #include "components/rlz/rlz_tracker.h" | 119 #include "components/rlz/rlz_tracker.h" |
116 #endif | 120 #endif |
117 | 121 |
118 using content::ChildProcessSecurityPolicy; | 122 using content::ChildProcessSecurityPolicy; |
119 using content::WebContents; | 123 using content::WebContents; |
120 using extensions::Extension; | 124 using extensions::Extension; |
121 | 125 |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 // run. However, when the set-as-default dialog has been suppressed, we | 828 // run. However, when the set-as-default dialog has been suppressed, we |
825 // need to allow it. | 829 // need to allow it. |
826 if (!is_first_run_ || | 830 if (!is_first_run_ || |
827 (browser_creator_ && | 831 (browser_creator_ && |
828 browser_creator_->is_default_browser_dialog_suppressed())) { | 832 browser_creator_->is_default_browser_dialog_suppressed())) { |
829 chrome::ShowDefaultBrowserPrompt(profile_, | 833 chrome::ShowDefaultBrowserPrompt(profile_, |
830 browser->host_desktop_type()); | 834 browser->host_desktop_type()); |
831 } | 835 } |
832 } | 836 } |
833 #endif | 837 #endif |
| 838 |
| 839 #if defined(OS_WIN) |
| 840 if (browser_creator_ && |
| 841 browser_creator_->show_desktop_search_redirection_infobar()) { |
| 842 DesktopSearchRedirectionInfobarDelegate::Show( |
| 843 InfoBarService::FromWebContents( |
| 844 browser->tab_strip_model()->GetActiveWebContents()), |
| 845 TemplateURLServiceFactory::GetForProfile(profile_) |
| 846 ->GetDefaultSearchProvider() |
| 847 ->AdjustedShortNameForLocaleDirection(), |
| 848 base::Bind(&chrome::ShowSettingsSubPage, base::Unretained(browser), |
| 849 chrome::kSearchEnginesSubPage), |
| 850 profile_->GetPrefs()); |
| 851 } |
| 852 #endif // defined(OS_WIN) |
834 } | 853 } |
835 } | 854 } |
836 | 855 |
837 void StartupBrowserCreatorImpl::AddStartupURLs( | 856 void StartupBrowserCreatorImpl::AddStartupURLs( |
838 std::vector<GURL>* startup_urls) const { | 857 std::vector<GURL>* startup_urls) const { |
839 // TODO(atwilson): Simplify the logic that decides which tabs to open on | 858 // TODO(atwilson): Simplify the logic that decides which tabs to open on |
840 // start-up and make it more consistent. http://crbug.com/248883 | 859 // start-up and make it more consistent. http://crbug.com/248883 |
841 | 860 |
842 // If we have urls specified by the first run master preferences use them | 861 // If we have urls specified by the first run master preferences use them |
843 // and nothing else. | 862 // and nothing else. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 #if defined(OS_WIN) | 1018 #if defined(OS_WIN) |
1000 TriggeredProfileResetter* triggered_profile_resetter = | 1019 TriggeredProfileResetter* triggered_profile_resetter = |
1001 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); | 1020 TriggeredProfileResetterFactory::GetForBrowserContext(profile_); |
1002 // TriggeredProfileResetter instance will be nullptr for incognito profiles. | 1021 // TriggeredProfileResetter instance will be nullptr for incognito profiles. |
1003 if (triggered_profile_resetter) { | 1022 if (triggered_profile_resetter) { |
1004 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); | 1023 has_reset_trigger = triggered_profile_resetter->HasResetTrigger(); |
1005 } | 1024 } |
1006 #endif // defined(OS_WIN) | 1025 #endif // defined(OS_WIN) |
1007 return has_reset_trigger; | 1026 return has_reset_trigger; |
1008 } | 1027 } |
OLD | NEW |