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/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 #endif | 328 #endif |
329 | 329 |
330 if (::switches::SettingsWindowEnabled()) { | 330 if (::switches::SettingsWindowEnabled()) { |
331 content::RecordAction(base::UserMetricsAction("ShowOptions")); | 331 content::RecordAction(base::UserMetricsAction("ShowOptions")); |
332 SettingsWindowManager::GetInstance()->ShowChromePageForProfile( | 332 SettingsWindowManager::GetInstance()->ShowChromePageForProfile( |
333 profile, GetSettingsUrl(sub_page_path)); | 333 profile, GetSettingsUrl(sub_page_path)); |
334 return; | 334 return; |
335 } | 335 } |
336 Browser* browser = chrome::FindTabbedBrowser(profile, false); | 336 Browser* browser = chrome::FindTabbedBrowser(profile, false); |
337 if (!browser) { | 337 if (!browser) { |
338 browser = new Browser(Browser::CreateParams(profile)); | 338 browser = new Browser(Browser::CreateParams(profile, true)); |
339 } | 339 } |
340 ShowSettingsSubPageInTabbedBrowser(browser, sub_page_path); | 340 ShowSettingsSubPageInTabbedBrowser(browser, sub_page_path); |
341 } | 341 } |
342 | 342 |
343 void ShowSettingsSubPageInTabbedBrowser(Browser* browser, | 343 void ShowSettingsSubPageInTabbedBrowser(Browser* browser, |
344 const std::string& sub_page) { | 344 const std::string& sub_page) { |
345 content::RecordAction(UserMetricsAction("ShowOptions")); | 345 content::RecordAction(UserMetricsAction("ShowOptions")); |
346 GURL gurl = GetSettingsUrl(sub_page); | 346 GURL gurl = GetSettingsUrl(sub_page); |
347 NavigateParams params(GetSingletonTabNavigateParams(browser, gurl)); | 347 NavigateParams params(GetSingletonTabNavigateParams(browser, gurl)); |
348 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; | 348 params.path_behavior = NavigateParams::IGNORE_AND_NAVIGATE; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 SigninManagerFactory::GetForProfile(original_profile); | 455 SigninManagerFactory::GetForProfile(original_profile); |
456 DCHECK(manager->IsSigninAllowed()); | 456 DCHECK(manager->IsSigninAllowed()); |
457 if (manager->IsAuthenticated()) | 457 if (manager->IsAuthenticated()) |
458 ShowSettings(browser); | 458 ShowSettings(browser); |
459 else | 459 else |
460 ShowBrowserSignin(browser, access_point); | 460 ShowBrowserSignin(browser, access_point); |
461 } | 461 } |
462 #endif | 462 #endif |
463 | 463 |
464 } // namespace chrome | 464 } // namespace chrome |
OLD | NEW |