summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/views/autofill/info_bubble.cc2
-rw-r--r--chrome/browser/ui/views/autofill/tooltip_icon.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/zoom_bubble_view.cc23
-rw-r--r--chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc10
-rw-r--r--chrome/browser/ui/views/validation_message_bubble_delegate.cc2
5 files changed, 12 insertions, 27 deletions
diff --git a/chrome/browser/ui/views/autofill/info_bubble.cc b/chrome/browser/ui/views/autofill/info_bubble.cc
index 5337093..c4f07dd 100644
--- a/chrome/browser/ui/views/autofill/info_bubble.cc
+++ b/chrome/browser/ui/views/autofill/info_bubble.cc
@@ -65,7 +65,7 @@ InfoBubble::InfoBubble(views::View* anchor,
kInfoBubbleHorizontalMargin,
kInfoBubbleVerticalMargin,
kInfoBubbleHorizontalMargin));
- set_use_focusless(true);
+ set_can_activate(false);
SetLayoutManager(new views::FillLayout);
views::Label* label = new views::Label(message);
diff --git a/chrome/browser/ui/views/autofill/tooltip_icon.cc b/chrome/browser/ui/views/autofill/tooltip_icon.cc
index 92f8e43..c066ea0 100644
--- a/chrome/browser/ui/views/autofill/tooltip_icon.cc
+++ b/chrome/browser/ui/views/autofill/tooltip_icon.cc
@@ -114,7 +114,7 @@ void TooltipIcon::ShowBubble() {
bubble_ = new TooltipBubble(this, tooltip_);
// When shown due to a gesture event, close on deactivate (i.e. don't use
// "focusless").
- bubble_->set_use_focusless(mouse_inside_);
+ bubble_->set_can_activate(!mouse_inside_);
bubble_->Show();
observer_.Add(bubble_->GetWidget());
diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
index 3ab1d2f..e1298bb 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc
@@ -63,21 +63,18 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
ZoomController::FromWebContents(web_contents);
const extensions::Extension* extension = zoom_controller->last_extension();
- // If the bubble is already showing in this window, its |auto_close_| value
- // is equal to |auto_close|, and the zoom change was not initiated by an
- // extension, then the bubble can be reused and only the label text needs to
- // be updated.
+ // If the bubble is already showing in this window and the zoom change was not
+ // initiated by an extension, then the bubble can be reused and only the label
+ // text needs to be updated.
if (zoom_bubble_ &&
zoom_bubble_->GetAnchorView() == anchor_view &&
- zoom_bubble_->auto_close_ == auto_close &&
!extension) {
zoom_bubble_->Refresh();
return;
}
- // If the bubble is already showing but its |auto_close_| value is not equal
- // to |auto_close|, the bubble's focus properties must change, so the
- // current bubble must be closed and a new one created.
+ // If the bubble is already showing but in a different tab, the current
+ // bubble must be closed and a new one created.
CloseBubble();
zoom_bubble_ = new ZoomBubbleView(anchor_view,
@@ -101,7 +98,7 @@ void ZoomBubbleView::ShowBubble(content::WebContents* web_contents,
if (is_fullscreen)
zoom_bubble_->AdjustForFullscreen(browser_view->GetBoundsInScreen());
- if (zoom_bubble_->use_focusless())
+ if (auto_close)
zoom_bubble_->GetWidget()->ShowInactive();
else
zoom_bubble_->GetWidget()->Show();
@@ -139,7 +136,6 @@ ZoomBubbleView::ZoomBubbleView(
immersive_mode_controller_(immersive_mode_controller) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
- set_use_focusless(auto_close);
set_notify_enter_exit_on_child(true);
// Add observers to close the bubble if the fullscreen state or immersive
@@ -250,12 +246,10 @@ void ZoomBubbleView::OnExtensionIconImageChanged(
}
void ZoomBubbleView::OnMouseEntered(const ui::MouseEvent& event) {
- set_use_focusless(false);
StopTimer();
}
void ZoomBubbleView::OnMouseExited(const ui::MouseEvent& event) {
- set_use_focusless(auto_close_);
StartTimerIfNecessary();
}
@@ -265,9 +259,8 @@ void ZoomBubbleView::OnGestureEvent(ui::GestureEvent* event) {
return;
}
- // If an auto-closing bubble was tapped, show a non-auto-closing bubble in
- // its place.
- ShowBubble(zoom_bubble_->web_contents_, false);
+ auto_close_ = false;
+ StopTimer();
event->SetHandled();
}
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
index 7a5dac3..27974f3 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc
@@ -538,13 +538,7 @@ void ManagePasswordsBubbleView::ShowBubble(content::WebContents* web_contents,
manage_passwords_bubble_->AdjustForFullscreen(
browser_view->GetBoundsInScreen());
}
- manage_passwords_bubble_->GetWidget()->Show();
- // set_use_focusless(true) has adverse effect on Windows.
- // 1) The bubble can't be the active window (which is not desired behavior).
- // 2) The bubble doesn't get WM_LBUTTONDOWN event. Therefore, all the buttons
- // get stuck.
- // TODO(vasilii): remove this line once the bug in infrastructure is resolved.
- manage_passwords_bubble_->set_use_focusless(false);
+ manage_passwords_bubble_->GetWidget()->ShowInactive();
}
// static
@@ -572,8 +566,6 @@ ManagePasswordsBubbleView::ManagePasswordsBubbleView(
never_save_passwords_(false) {
// Compensate for built-in vertical padding in the anchor view's image.
set_anchor_view_insets(gfx::Insets(5, 0, 5, 0));
- // Don't focus by default.
- set_use_focusless(true);
if (anchor_view)
anchor_view->SetActive(true);
}
diff --git a/chrome/browser/ui/views/validation_message_bubble_delegate.cc b/chrome/browser/ui/views/validation_message_bubble_delegate.cc
index 0e857fa..ea79333 100644
--- a/chrome/browser/ui/views/validation_message_bubble_delegate.cc
+++ b/chrome/browser/ui/views/validation_message_bubble_delegate.cc
@@ -24,7 +24,7 @@ ValidationMessageBubbleDelegate::ValidationMessageBubbleDelegate(
const base::string16& sub_text,
Observer* observer)
: observer_(observer), width_(0), height_(0) {
- set_use_focusless(true);
+ set_can_activate(false);
set_arrow(views::BubbleBorder::TOP_LEFT);
SetAnchorRect(anchor_in_screen);