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

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: . 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/zoom_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c868321aabd99616fb8e4742c92f1c08f14f2c11 100644
--- a/chrome/browser/ui/views/location_bar/zoom_view.cc
+++ b/chrome/browser/ui/views/location_bar/zoom_view.cc
@@ -16,8 +16,8 @@
#include "ui/gfx/size.h"
ZoomView::ZoomView(LocationBarView::Delegate* location_bar_delegate)
- : location_bar_delegate_(location_bar_delegate) {
- SetAccessibilityFocusable(true);
+ : BubbleIconView(nullptr, 0),
+ location_bar_delegate_(location_bar_delegate) {
Update(NULL);
}
@@ -40,43 +40,14 @@ void ZoomView::Update(ZoomController* zoom_controller) {
}
void ZoomView::GetAccessibleState(ui::AXViewState* state) {
msw 2014/10/24 00:39:48 nit: make the definition order match the decl orde
Dan Beam 2014/10/24 00:44:19 Done.
+ 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);
}
« no previous file with comments | « chrome/browser/ui/views/location_bar/zoom_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698