OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 void BrowserView::SetFocusToLocationBar(bool select_all) { | 868 void BrowserView::SetFocusToLocationBar(bool select_all) { |
869 #if defined(OS_WIN) | 869 #if defined(OS_WIN) |
870 // On Windows changing focus to the location bar causes the browser window | 870 // On Windows changing focus to the location bar causes the browser window |
871 // to become active. This can steal focus if the user has another window | 871 // to become active. This can steal focus if the user has another window |
872 // open already. | 872 // open already. |
873 if (!force_location_bar_focus_ && !IsActive()) | 873 if (!force_location_bar_focus_ && !IsActive()) |
874 return; | 874 return; |
875 #endif | 875 #endif |
876 | 876 |
877 LocationBarView* location_bar = GetLocationBarView(); | 877 LocationBarView* location_bar = GetLocationBarView(); |
878 if (location_bar->IsFocusableInRootView()) { | 878 if (location_bar->IsLocationEntryFocusableInRootView()) { |
879 // Location bar got focus. | 879 // Location bar got focus. |
880 location_bar->FocusLocation(select_all); | 880 location_bar->FocusLocation(select_all); |
881 } else { | 881 } else { |
882 // If none of location bar got focus, | 882 // If none of location bar got focus, |
883 // then clear focus. | 883 // then clear focus. |
884 views::FocusManager* focus_manager = GetFocusManager(); | 884 views::FocusManager* focus_manager = GetFocusManager(); |
885 DCHECK(focus_manager); | 885 DCHECK(focus_manager); |
886 focus_manager->ClearFocus(); | 886 focus_manager->ClearFocus(); |
887 } | 887 } |
888 } | 888 } |
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2638 browser::CreateViewsBubble(bubble); | 2638 browser::CreateViewsBubble(bubble); |
2639 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2639 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2640 bubble->Show(); | 2640 bubble->Show(); |
2641 } | 2641 } |
2642 | 2642 |
2643 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2643 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2644 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2644 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2645 if (button) | 2645 if (button) |
2646 button->ShowAvatarBubble(); | 2646 button->ShowAvatarBubble(); |
2647 } | 2647 } |
OLD | NEW |