OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2519 AvatarBubbleMode mode, | 2519 AvatarBubbleMode mode, |
2520 const signin::ManageAccountsParams& manage_accounts_params, | 2520 const signin::ManageAccountsParams& manage_accounts_params, |
2521 signin_metrics::AccessPoint access_point, | 2521 signin_metrics::AccessPoint access_point, |
2522 bool focus_first_profile_button) { | 2522 bool focus_first_profile_button) { |
2523 #if !defined(OS_CHROMEOS) | 2523 #if !defined(OS_CHROMEOS) |
2524 // Do not show avatar bubble if there is no avatar menu button. | 2524 // Do not show avatar bubble if there is no avatar menu button. |
2525 if (!frame_->GetNewAvatarMenuButton()) | 2525 if (!frame_->GetNewAvatarMenuButton()) |
2526 return; | 2526 return; |
2527 | 2527 |
2528 profiles::BubbleViewMode bubble_view_mode; | 2528 profiles::BubbleViewMode bubble_view_mode; |
2529 profiles::TutorialMode tutorial_mode; | 2529 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode); |
2530 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, | |
2531 &tutorial_mode); | |
2532 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { | 2530 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { |
2533 browser_->signin_view_controller()->ShowModalSignin( | 2531 browser_->signin_view_controller()->ShowModalSignin( |
2534 bubble_view_mode, browser_.get(), access_point); | 2532 bubble_view_mode, browser_.get(), access_point); |
2535 } else { | 2533 } else { |
2536 ProfileChooserView::ShowBubble(bubble_view_mode, tutorial_mode, | 2534 ProfileChooserView::ShowBubble(bubble_view_mode, manage_accounts_params, |
2537 manage_accounts_params, access_point, | 2535 access_point, |
2538 frame_->GetNewAvatarMenuButton(), browser(), | 2536 frame_->GetNewAvatarMenuButton(), browser(), |
2539 focus_first_profile_button); | 2537 focus_first_profile_button); |
2540 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); | 2538 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); |
2541 } | 2539 } |
2542 #else | 2540 #else |
2543 NOTREACHED(); | 2541 NOTREACHED(); |
2544 #endif | 2542 #endif |
2545 } | 2543 } |
2546 | 2544 |
2547 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { | 2545 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2693 } | 2691 } |
2694 | 2692 |
2695 extensions::ActiveTabPermissionGranter* | 2693 extensions::ActiveTabPermissionGranter* |
2696 BrowserView::GetActiveTabPermissionGranter() { | 2694 BrowserView::GetActiveTabPermissionGranter() { |
2697 content::WebContents* web_contents = GetActiveWebContents(); | 2695 content::WebContents* web_contents = GetActiveWebContents(); |
2698 if (!web_contents) | 2696 if (!web_contents) |
2699 return nullptr; | 2697 return nullptr; |
2700 return extensions::TabHelper::FromWebContents(web_contents) | 2698 return extensions::TabHelper::FromWebContents(web_contents) |
2701 ->active_tab_permission_granter(); | 2699 ->active_tab_permission_granter(); |
2702 } | 2700 } |
OLD | NEW |