summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/base_button.cc3
-rw-r--r--chrome/views/menu_button.cc3
-rw-r--r--chrome/views/native_button.cc3
-rw-r--r--chrome/views/view.cc3
4 files changed, 4 insertions, 8 deletions
diff --git a/chrome/views/base_button.cc b/chrome/views/base_button.cc
index bd4987b..bea0c2f 100644
--- a/chrome/views/base_button.cc
+++ b/chrome/views/base_button.cc
@@ -147,8 +147,7 @@ bool BaseButton::OnMousePressed(const MouseEvent& e) {
if (IsTriggerableEvent(e) && HitTest(e.location())) {
SetState(BS_PUSHED);
}
- if (IsFocusable())
- RequestFocus();
+ RequestFocus();
}
return true;
}
diff --git a/chrome/views/menu_button.cc b/chrome/views/menu_button.cc
index 0b696ff..ff0400a 100644
--- a/chrome/views/menu_button.cc
+++ b/chrome/views/menu_button.cc
@@ -180,8 +180,7 @@ bool MenuButton::Activate() {
}
bool MenuButton::OnMousePressed(const MouseEvent& e) {
- if (IsFocusable())
- RequestFocus();
+ RequestFocus();
if (GetState() != BS_DISABLED) {
// If we're draggable (GetDragOperations returns a non-zero value), then
// don't pop on press, instead wait for release.
diff --git a/chrome/views/native_button.cc b/chrome/views/native_button.cc
index 00aea52..d6db326 100644
--- a/chrome/views/native_button.cc
+++ b/chrome/views/native_button.cc
@@ -191,8 +191,7 @@ void NativeButton::Init(const std::wstring& label, bool is_default) {
void NativeButton::Clicked() {
DCHECK(enabled_);
// Give the focus to the button.
- if (IsFocusable())
- RequestFocus();
+ RequestFocus();
if (listener_)
listener_->ButtonPressed(this);
diff --git a/chrome/views/view.cc b/chrome/views/view.cc
index 3a06c3b..59e5b73 100644
--- a/chrome/views/view.cc
+++ b/chrome/views/view.cc
@@ -1372,9 +1372,8 @@ bool View::IsVisibleInRootView() const {
void View::RequestFocus() {
RootView* rv = GetRootView();
- if (rv) {
+ if (rv && IsFocusable())
rv->FocusView(this);
- }
}
void View::WillGainFocus() {