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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_view.cc

Issue 420533002: zoom bubble: Close if anchor is clicked while bubble is showing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/zoom_view.cc
diff --git a/chrome/browser/ui/views/location_bar/zoom_view.cc b/chrome/browser/ui/views/location_bar/zoom_view.cc
index a71860e44f9afb689efb2c1bacc1247b49654513..70b5f6d92eee4da2ce530e3facf259595759dcd6 100644
--- a/chrome/browser/ui/views/location_bar/zoom_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_view.cc
@@ -17,7 +17,6 @@
ZoomView::ZoomView(LocationBarView::Delegate* location_bar_delegate)
: location_bar_delegate_(location_bar_delegate) {
- SetAccessibilityFocusable(true);
Update(NULL);
}
@@ -40,43 +39,14 @@ void ZoomView::Update(ZoomController* zoom_controller) {
}
void ZoomView::GetAccessibleState(ui::AXViewState* state) {
+ BubbleIconView::GetAccessibleState(state);
state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_ZOOM);
- state->role = ui::AX_ROLE_BUTTON;
}
-bool ZoomView::GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const {
- // Don't show tooltip if the zoom bubble is displayed.
- return !ZoomBubbleView::IsShowing() && ImageView::GetTooltipText(p, tooltip);
+bool ZoomView::IsBubbleShowing() const {
+ return ZoomBubbleView::IsShowing();
}
-bool ZoomView::OnMousePressed(const ui::MouseEvent& event) {
- // Do nothing until mouse is released.
- return true;
-}
-
-void ZoomView::OnMouseReleased(const ui::MouseEvent& event) {
- if (event.IsOnlyLeftMouseButton() && HitTestPoint(event.location()))
- ActivateBubble();
-}
-
-bool ZoomView::OnKeyPressed(const ui::KeyEvent& event) {
- if (event.key_code() != ui::VKEY_SPACE &&
- event.key_code() != ui::VKEY_RETURN) {
- return false;
- }
-
- ActivateBubble();
- return true;
-}
-
-void ZoomView::OnGestureEvent(ui::GestureEvent* event) {
- if (event->type() == ui::ET_GESTURE_TAP) {
- ActivateBubble();
- event->SetHandled();
- }
-}
-
-void ZoomView::ActivateBubble() {
+void ZoomView::OnExecuting(BubbleIconView::ExecuteSource source) {
ZoomBubbleView::ShowBubble(location_bar_delegate_->GetWebContents(), false);
}

Powered by Google App Engine
This is Rietveld 408576698