Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2687693002: Linux/Windows: Setting focus to the first profile in profile switcher (Closed)
Patch Set: Renaming |focus_first_profile| to |is_source_keyboard| Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2451 matching lines...) Expand 10 before | Expand all | Expand 10 after
2462 default: 2462 default:
2463 // Do nothing. 2463 // Do nothing.
2464 break; 2464 break;
2465 } 2465 }
2466 #endif 2466 #endif
2467 } 2467 }
2468 2468
2469 void BrowserView::ShowAvatarBubbleFromAvatarButton( 2469 void BrowserView::ShowAvatarBubbleFromAvatarButton(
2470 AvatarBubbleMode mode, 2470 AvatarBubbleMode mode,
2471 const signin::ManageAccountsParams& manage_accounts_params, 2471 const signin::ManageAccountsParams& manage_accounts_params,
2472 signin_metrics::AccessPoint access_point) { 2472 signin_metrics::AccessPoint access_point,
2473 bool focus_first_profile_button) {
2473 #if !defined(OS_CHROMEOS) 2474 #if !defined(OS_CHROMEOS)
2474 // Do not show avatar bubble if there is no avatar menu button. 2475 // Do not show avatar bubble if there is no avatar menu button.
2475 if (!frame_->GetNewAvatarMenuButton()) 2476 if (!frame_->GetNewAvatarMenuButton())
2476 return; 2477 return;
2477 2478
2478 profiles::BubbleViewMode bubble_view_mode; 2479 profiles::BubbleViewMode bubble_view_mode;
2479 profiles::TutorialMode tutorial_mode; 2480 profiles::TutorialMode tutorial_mode;
2480 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode, 2481 profiles::BubbleViewModeFromAvatarBubbleMode(mode, &bubble_view_mode,
2481 &tutorial_mode); 2482 &tutorial_mode);
2482 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) { 2483 if (SigninViewController::ShouldShowModalSigninForMode(bubble_view_mode)) {
2483 browser_->ShowModalSigninWindow(bubble_view_mode, access_point); 2484 browser_->ShowModalSigninWindow(bubble_view_mode, access_point);
2484 } else { 2485 } else {
2485 ProfileChooserView::ShowBubble(bubble_view_mode, tutorial_mode, 2486 ProfileChooserView::ShowBubble(bubble_view_mode, tutorial_mode,
2486 manage_accounts_params, access_point, 2487 manage_accounts_params, access_point,
2487 frame_->GetNewAvatarMenuButton(), browser()); 2488 frame_->GetNewAvatarMenuButton(), browser(),
2489 focus_first_profile_button);
2488 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE); 2490 ProfileMetrics::LogProfileOpenMethod(ProfileMetrics::ICON_AVATAR_BUBBLE);
2489 } 2491 }
2490 #else 2492 #else
2491 NOTREACHED(); 2493 NOTREACHED();
2492 #endif 2494 #endif
2493 } 2495 }
2494 2496
2495 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() { 2497 int BrowserView::GetRenderViewHeightInsetWithDetachedBookmarkBar() {
2496 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED || 2498 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED ||
2497 !bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) { 2499 !bookmark_bar_view_ || !bookmark_bar_view_->IsDetached()) {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 } 2638 }
2637 2639
2638 extensions::ActiveTabPermissionGranter* 2640 extensions::ActiveTabPermissionGranter*
2639 BrowserView::GetActiveTabPermissionGranter() { 2641 BrowserView::GetActiveTabPermissionGranter() {
2640 content::WebContents* web_contents = GetActiveWebContents(); 2642 content::WebContents* web_contents = GetActiveWebContents();
2641 if (!web_contents) 2643 if (!web_contents)
2642 return nullptr; 2644 return nullptr;
2643 return extensions::TabHelper::FromWebContents(web_contents) 2645 return extensions::TabHelper::FromWebContents(web_contents)
2644 ->active_tab_permission_granter(); 2646 ->active_tab_permission_granter();
2645 } 2647 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/profiles/profile_chooser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698