| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 #include "ui/views/widget/native_widget.h" | 145 #include "ui/views/widget/native_widget.h" |
| 146 #include "ui/views/widget/root_view.h" | 146 #include "ui/views/widget/root_view.h" |
| 147 #include "ui/views/widget/widget.h" | 147 #include "ui/views/widget/widget.h" |
| 148 #include "ui/views/window/dialog_delegate.h" | 148 #include "ui/views/window/dialog_delegate.h" |
| 149 | 149 |
| 150 #if defined(OS_CHROMEOS) | 150 #if defined(OS_CHROMEOS) |
| 151 #include "chrome/browser/ui/ash/ash_util.h" | 151 #include "chrome/browser/ui/ash/ash_util.h" |
| 152 #endif // defined(OS_CHROMEOS) | 152 #endif // defined(OS_CHROMEOS) |
| 153 | 153 |
| 154 #if !defined(OS_CHROMEOS) | 154 #if !defined(OS_CHROMEOS) |
| 155 #include "chrome/browser/ui/signin_view_controller.h" |
| 155 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 156 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
| 156 #endif // !defined(OS_CHROMEOS) | 157 #endif // !defined(OS_CHROMEOS) |
| 157 | 158 |
| 158 #if defined(USE_AURA) | 159 #if defined(USE_AURA) |
| 159 #include "chrome/browser/ui/views/theme_profile_key.h" | 160 #include "chrome/browser/ui/views/theme_profile_key.h" |
| 160 #include "ui/aura/client/window_parenting_client.h" | 161 #include "ui/aura/client/window_parenting_client.h" |
| 161 #include "ui/aura/window.h" | 162 #include "ui/aura/window.h" |
| 162 #include "ui/aura/window_tree_host.h" | 163 #include "ui/aura/window_tree_host.h" |
| 163 #endif | 164 #endif |
| 164 | 165 |
| (...skipping 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 #if !defined(OS_CHROMEOS) | 2521 #if !defined(OS_CHROMEOS) |
| 2521 // Do not show avatar bubble if there is no avatar menu button. | 2522 // Do not show avatar bubble if there is no avatar menu button. |
| 2522 if (!frame_->GetNewAvatarMenuButton()) | 2523 if (!frame_->GetNewAvatarMenuButton()) |
| 2523 return; | 2524 return; |
| 2524 | 2525 |
| 2525 profiles::BubbleViewMode bubble_view_mode; | 2526 profiles::BubbleViewMode bubble_view_mode; |
| 2526 profiles::TutorialMode tutorial_mode; | 2527 profiles::TutorialMode tutorial_mode; |
| 2527 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, | 2528 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, |
| 2528 &tutorial_mode); | 2529 &tutorial_mode); |
| 2529 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { | 2530 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { |
| 2530 browser_->ShowModalSigninWindow(bubble_view_mode, access_point); | 2531 browser_->signin_view_controller()->ShowModalSignin( |
| 2532 bubble_view_mode, browser_.get(), access_point); |
| 2531 } else { | 2533 } else { |
| 2532 ProfileChooserView::ShowBubble(bubble_view_mode, tutorial_mode, | 2534 ProfileChooserView::ShowBubble(bubble_view_mode, tutorial_mode, |
| 2533 manage_accounts_params, access_point, | 2535 manage_accounts_params, access_point, |
| 2534 frame_->GetNewAvatarMenuButton(), browser(), | 2536 frame_->GetNewAvatarMenuButton(), browser(), |
| 2535 focus_first_profile_button); | 2537 focus_first_profile_button); |
| 2536 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); | 2538 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); |
| 2537 } | 2539 } |
| 2538 #else | 2540 #else |
| 2539 NOTREACHED(); | 2541 NOTREACHED(); |
| 2540 #endif | 2542 #endif |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 } | 2686 } |
| 2685 | 2687 |
| 2686 extensions::ActiveTabPermissionGranter* | 2688 extensions::ActiveTabPermissionGranter* |
| 2687 BrowserView::GetActiveTabPermissionGranter() { | 2689 BrowserView::GetActiveTabPermissionGranter() { |
| 2688 content::WebContents* web_contents = GetActiveWebContents(); | 2690 content::WebContents* web_contents = GetActiveWebContents(); |
| 2689 if (!web_contents) | 2691 if (!web_contents) |
| 2690 return nullptr; | 2692 return nullptr; |
| 2691 return extensions::TabHelper::FromWebContents(web_contents) | 2693 return extensions::TabHelper::FromWebContents(web_contents) |
| 2692 ->active_tab_permission_granter(); | 2694 ->active_tab_permission_granter(); |
| 2693 } | 2695 } |
| OLD | NEW |