| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 access_point != signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS && | 430 access_point != signin_metrics::AccessPoint::ACCESS_POINT_EXTENSIONS && |
| 431 !switched_browser; | 431 !switched_browser; |
| 432 #if defined(OS_CHROMEOS) | 432 #if defined(OS_CHROMEOS) |
| 433 // ChromeOS doesn't have the avatar bubble. | 433 // ChromeOS doesn't have the avatar bubble. |
| 434 show_avatar_bubble = false; | 434 show_avatar_bubble = false; |
| 435 #endif | 435 #endif |
| 436 | 436 |
| 437 if (show_avatar_bubble) { | 437 if (show_avatar_bubble) { |
| 438 browser->window()->ShowAvatarBubbleFromAvatarButton( | 438 browser->window()->ShowAvatarBubbleFromAvatarButton( |
| 439 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, | 439 BrowserWindow::AVATAR_BUBBLE_MODE_SIGNIN, |
| 440 signin::ManageAccountsParams(), access_point); | 440 signin::ManageAccountsParams(), access_point, false); |
| 441 } else { | 441 } else { |
| 442 NavigateToSingletonTab( | 442 NavigateToSingletonTab( |
| 443 browser, | 443 browser, |
| 444 signin::GetPromoURL( | 444 signin::GetPromoURL( |
| 445 access_point, signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, | 445 access_point, signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, |
| 446 false)); | 446 false)); |
| 447 DCHECK_GT(browser->tab_strip_model()->count(), 0); | 447 DCHECK_GT(browser->tab_strip_model()->count(), 0); |
| 448 } | 448 } |
| 449 } | 449 } |
| 450 | 450 |
| 451 void ShowBrowserSigninOrSettings(Browser* browser, | 451 void ShowBrowserSigninOrSettings(Browser* browser, |
| 452 signin_metrics::AccessPoint access_point) { | 452 signin_metrics::AccessPoint access_point) { |
| 453 Profile* original_profile = browser->profile()->GetOriginalProfile(); | 453 Profile* original_profile = browser->profile()->GetOriginalProfile(); |
| 454 SigninManagerBase* manager = | 454 SigninManagerBase* manager = |
| 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 |