| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 } | 278 } |
| 279 | 279 |
| 280 void ShowSettingsSubPageForProfile(Profile* profile, | 280 void ShowSettingsSubPageForProfile(Profile* profile, |
| 281 const std::string& sub_page) { | 281 const std::string& sub_page) { |
| 282 if (::switches::SettingsWindowEnabled()) { | 282 if (::switches::SettingsWindowEnabled()) { |
| 283 content::RecordAction(base::UserMetricsAction("ShowOptions")); | 283 content::RecordAction(base::UserMetricsAction("ShowOptions")); |
| 284 SettingsWindowManager::GetInstance()->ShowChromePageForProfile( | 284 SettingsWindowManager::GetInstance()->ShowChromePageForProfile( |
| 285 profile, GetSettingsUrl(sub_page)); | 285 profile, GetSettingsUrl(sub_page)); |
| 286 return; | 286 return; |
| 287 } | 287 } |
| 288 Browser* browser = | 288 Browser* browser = chrome::FindTabbedBrowser(profile, false); |
| 289 chrome::FindTabbedBrowser(profile, false, HOST_DESKTOP_TYPE_NATIVE); | |
| 290 if (!browser) { | 289 if (!browser) { |
| 291 browser = new Browser( | 290 browser = new Browser( |
| 292 Browser::CreateParams(profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); | 291 Browser::CreateParams(profile, chrome::HOST_DESKTOP_TYPE_NATIVE)); |
| 293 } | 292 } |
| 294 ShowSettingsSubPageInTabbedBrowser(browser, sub_page); | 293 ShowSettingsSubPageInTabbedBrowser(browser, sub_page); |
| 295 } | 294 } |
| 296 | 295 |
| 297 void ShowSettingsSubPageInTabbedBrowser(Browser* browser, | 296 void ShowSettingsSubPageInTabbedBrowser(Browser* browser, |
| 298 const std::string& sub_page) { | 297 const std::string& sub_page) { |
| 299 content::RecordAction(UserMetricsAction("ShowOptions")); | 298 content::RecordAction(UserMetricsAction("ShowOptions")); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 SigninManagerFactory::GetForProfile(original_profile); | 410 SigninManagerFactory::GetForProfile(original_profile); |
| 412 DCHECK(manager->IsSigninAllowed()); | 411 DCHECK(manager->IsSigninAllowed()); |
| 413 if (manager->IsAuthenticated()) | 412 if (manager->IsAuthenticated()) |
| 414 ShowSettings(browser); | 413 ShowSettings(browser); |
| 415 else | 414 else |
| 416 ShowBrowserSignin(browser, access_point); | 415 ShowBrowserSignin(browser, access_point); |
| 417 } | 416 } |
| 418 #endif | 417 #endif |
| 419 | 418 |
| 420 } // namespace chrome | 419 } // namespace chrome |
| OLD | NEW |