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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 const std::string& scheme) { | 276 const std::string& scheme) { |
277 if (!browser->is_type_popup() || !browser->is_trusted_source()) | 277 if (!browser->is_type_popup() || !browser->is_trusted_source()) |
278 return false; | 278 return false; |
279 if (scheme.empty()) // Any trusted popup window | 279 if (scheme.empty()) // Any trusted popup window |
280 return true; | 280 return true; |
281 const content::WebContents* web_contents = | 281 const content::WebContents* web_contents = |
282 browser->tab_strip_model()->GetWebContentsAt(0); | 282 browser->tab_strip_model()->GetWebContentsAt(0); |
283 if (!web_contents) | 283 if (!web_contents) |
284 return false; | 284 return false; |
285 GURL url(web_contents->GetURL()); | 285 GURL url(web_contents->GetURL()); |
286 return url.SchemeIs(scheme.c_str()); | 286 return url.SchemeIs(scheme); |
287 } | 287 } |
288 | 288 |
289 | 289 |
290 void ShowSettings(Browser* browser) { | 290 void ShowSettings(Browser* browser) { |
291 ShowSettingsSubPage(browser, std::string()); | 291 ShowSettingsSubPage(browser, std::string()); |
292 } | 292 } |
293 | 293 |
294 void ShowSettingsSubPage(Browser* browser, const std::string& sub_page) { | 294 void ShowSettingsSubPage(Browser* browser, const std::string& sub_page) { |
295 if (::switches::SettingsWindowEnabled()) { | 295 if (::switches::SettingsWindowEnabled()) { |
296 ShowSettingsSubPageForProfile(browser->profile(), sub_page); | 296 ShowSettingsSubPageForProfile(browser->profile(), sub_page); |
(...skipping 158 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 |