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/chrome_pages.h" | 5 #include "chrome/browser/ui/chrome_pages.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "chrome/browser/download/download_shelf.h" | 10 #include "chrome/browser/download/download_shelf.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 content::RecordAction(UserMetricsAction("Import_ShowDlg")); | 151 content::RecordAction(UserMetricsAction("Import_ShowDlg")); |
152 ShowSettingsSubPage(browser, kImportDataSubPage); | 152 ShowSettingsSubPage(browser, kImportDataSubPage); |
153 } | 153 } |
154 | 154 |
155 void ShowInstantConfirmDialog(Browser* browser) { | 155 void ShowInstantConfirmDialog(Browser* browser) { |
156 ShowSettingsSubPage(browser, kInstantConfirmPage); | 156 ShowSettingsSubPage(browser, kInstantConfirmPage); |
157 } | 157 } |
158 | 158 |
159 void ShowAboutChrome(Browser* browser) { | 159 void ShowAboutChrome(Browser* browser) { |
160 content::RecordAction(UserMetricsAction("AboutChrome")); | 160 content::RecordAction(UserMetricsAction("AboutChrome")); |
161 #if !defined(OS_WIN) | |
162 NavigateParams params( | 161 NavigateParams params( |
163 GetSingletonTabNavigateParams(browser, GURL(kChromeUIUberURL))); | 162 GetSingletonTabNavigateParams(browser, GURL(kChromeUIUberURL))); |
164 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; | 163 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
165 ShowSingletonTabOverwritingNTP(browser, params); | 164 ShowSingletonTabOverwritingNTP(browser, params); |
166 #else | |
167 // crbug.com/115123. | |
168 browser->window()->ShowAboutChromeDialog(); | |
169 #endif | |
170 } | 165 } |
171 | 166 |
172 void ShowSearchEngineSettings(Browser* browser) { | 167 void ShowSearchEngineSettings(Browser* browser) { |
173 content::RecordAction(UserMetricsAction("EditSearchEngines")); | 168 content::RecordAction(UserMetricsAction("EditSearchEngines")); |
174 ShowSettingsSubPage(browser, kSearchEnginesSubPage); | 169 ShowSettingsSubPage(browser, kSearchEnginesSubPage); |
175 } | 170 } |
176 | 171 |
177 void ShowSyncSetup(Browser* browser, SyncPromoUI::Source source) { | 172 void ShowSyncSetup(Browser* browser, SyncPromoUI::Source source) { |
178 ProfileSyncService* service = | 173 ProfileSyncService* service = |
179 ProfileSyncServiceFactory::GetInstance()->GetForProfile( | 174 ProfileSyncServiceFactory::GetInstance()->GetForProfile( |
180 browser->profile()->GetOriginalProfile()); | 175 browser->profile()->GetOriginalProfile()); |
181 LoginUIService* login_service = LoginUIServiceFactory::GetForProfile( | 176 LoginUIService* login_service = LoginUIServiceFactory::GetForProfile( |
182 browser->profile()->GetOriginalProfile()); | 177 browser->profile()->GetOriginalProfile()); |
183 if (service->HasSyncSetupCompleted()) { | 178 if (service->HasSyncSetupCompleted()) { |
184 ShowSettings(browser); | 179 ShowSettings(browser); |
185 } else if (SyncPromoUI::ShouldShowSyncPromo(browser->profile()) && | 180 } else if (SyncPromoUI::ShouldShowSyncPromo(browser->profile()) && |
186 login_service->current_login_ui() == NULL) { | 181 login_service->current_login_ui() == NULL) { |
187 // There is no currently active login UI, so display a new promo page. | 182 // There is no currently active login UI, so display a new promo page. |
188 GURL url(SyncPromoUI::GetSyncPromoURL(GURL(), source)); | 183 GURL url(SyncPromoUI::GetSyncPromoURL(GURL(), source)); |
189 NavigateParams params(GetSingletonTabNavigateParams(browser, GURL(url))); | 184 NavigateParams params(GetSingletonTabNavigateParams(browser, GURL(url))); |
190 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; | 185 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
191 ShowSingletonTabOverwritingNTP(browser, params); | 186 ShowSingletonTabOverwritingNTP(browser, params); |
192 } else { | 187 } else { |
193 LoginUIServiceFactory::GetForProfile( | 188 LoginUIServiceFactory::GetForProfile( |
194 browser->profile()->GetOriginalProfile())->ShowLoginUI(browser); | 189 browser->profile()->GetOriginalProfile())->ShowLoginUI(browser); |
195 } | 190 } |
196 } | 191 } |
197 | 192 |
198 } // namespace chrome | 193 } // namespace chrome |
OLD | NEW |