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

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

Issue 14225016: Add key to focus infobars (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 // Start the traversal within the main toolbar. SetPaneFocus stores 1039 // Start the traversal within the main toolbar. SetPaneFocus stores
1040 // the current focused view before changing focus. 1040 // the current focused view before changing focus.
1041 toolbar_->SetPaneFocus(NULL); 1041 toolbar_->SetPaneFocus(NULL);
1042 } 1042 }
1043 1043
1044 void BrowserView::FocusBookmarksToolbar() { 1044 void BrowserView::FocusBookmarksToolbar() {
1045 DCHECK(!immersive_mode_controller_->IsEnabled()); 1045 DCHECK(!immersive_mode_controller_->IsEnabled());
1046 if (bookmark_bar_view_.get() && 1046 if (bookmark_bar_view_.get() &&
1047 bookmark_bar_view_->visible() && 1047 bookmark_bar_view_->visible() &&
1048 bookmark_bar_view_->GetPreferredSize().height() != 0) { 1048 bookmark_bar_view_->GetPreferredSize().height() != 0) {
1049 bookmark_bar_view_->SetPaneFocus(bookmark_bar_view_.get()); 1049 bookmark_bar_view_->SetPaneFocusAndFocusDefault();
1050 } 1050 }
1051 } 1051 }
1052 1052
1053 void BrowserView::FocusInfobars() {
1054 if (infobar_container_->child_count() > 0)
1055 infobar_container_->SetPaneFocusAndFocusDefault();
1056 }
1057
1053 void BrowserView::FocusAppMenu() { 1058 void BrowserView::FocusAppMenu() {
1054 // Chrome doesn't have a traditional menu bar, but it has a menu button in the 1059 // Chrome doesn't have a traditional menu bar, but it has a menu button in the
1055 // main toolbar that plays the same role. If the user presses a key that 1060 // main toolbar that plays the same role. If the user presses a key that
1056 // would typically focus the menu bar, tell the toolbar to focus the menu 1061 // would typically focus the menu bar, tell the toolbar to focus the menu
1057 // button. If the user presses the key again, return focus to the previous 1062 // button. If the user presses the key again, return focus to the previous
1058 // location. 1063 // location.
1059 // 1064 //
1060 // Not used on the Mac, which has a normal menu bar. 1065 // Not used on the Mac, which has a normal menu bar.
1061 if (toolbar_->IsAppMenuFocused()) { 1066 if (toolbar_->IsAppMenuFocused()) {
1062 RestoreFocus(); 1067 RestoreFocus();
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2721 2726
2722 Browser* modal_browser = 2727 Browser* modal_browser =
2723 chrome::FindBrowserWithWebContents(active_dialog->web_contents()); 2728 chrome::FindBrowserWithWebContents(active_dialog->web_contents());
2724 if (modal_browser && (browser_ != modal_browser)) { 2729 if (modal_browser && (browser_ != modal_browser)) {
2725 modal_browser->window()->FlashFrame(true); 2730 modal_browser->window()->FlashFrame(true);
2726 modal_browser->window()->Activate(); 2731 modal_browser->window()->Activate();
2727 } 2732 }
2728 2733
2729 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2734 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2730 } 2735 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/test/base/test_browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698