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

Side by Side Diff: chrome/browser/ui/views/location_bar/bubble_icon_view.cc

Issue 394403003: Close the password bubble on the icon click. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed the unnecessary command Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/location_bar/bubble_icon_view.h" 5 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h"
6 6
7 #include "chrome/browser/command_updater.h" 7 #include "chrome/browser/command_updater.h"
8 #include "ui/accessibility/ax_view_state.h" 8 #include "ui/accessibility/ax_view_state.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 10
(...skipping 16 matching lines...) Expand all
27 base::string16* tooltip) const { 27 base::string16* tooltip) const {
28 if (IsBubbleShowing()) 28 if (IsBubbleShowing())
29 return false; 29 return false;
30 30
31 return views::ImageView::GetTooltipText(p, tooltip); 31 return views::ImageView::GetTooltipText(p, tooltip);
32 } 32 }
33 33
34 bool BubbleIconView::OnMousePressed(const ui::MouseEvent& event) { 34 bool BubbleIconView::OnMousePressed(const ui::MouseEvent& event) {
35 // If the bubble is showing then don't reshow it when the mouse is released. 35 // If the bubble is showing then don't reshow it when the mouse is released.
36 suppress_mouse_released_action_ = IsBubbleShowing(); 36 suppress_mouse_released_action_ = IsBubbleShowing();
37 if (suppress_mouse_released_action_)
38 OnMousePressedIgnored();
Mike West 2014/07/22 12:08:40 Is the timing of this call important? If not, it s
vasilii 2014/07/22 14:18:51 All other bubbles lose the focus on mouse down eve
Mike West 2014/07/22 14:23:47 Hrm. *shrug* Either way. If this is consistent wit
37 39
38 // We want to show the bubble on mouse release; that is the standard behavior 40 // We want to show the bubble on mouse release; that is the standard behavior
39 // for buttons. 41 // for buttons.
40 return true; 42 return true;
41 } 43 }
42 44
43 void BubbleIconView::OnMouseReleased(const ui::MouseEvent& event) { 45 void BubbleIconView::OnMouseReleased(const ui::MouseEvent& event) {
44 // If this is the second click on this view then the bubble was showing on the 46 // If this is the second click on this view then the bubble was showing on the
45 // mouse pressed event and is hidden now. Prevent the bubble from reshowing by 47 // mouse pressed event and is hidden now. Prevent the bubble from reshowing by
46 // doing nothing here. 48 // doing nothing here.
(...skipping 18 matching lines...) Expand all
65 return false; 67 return false;
66 } 68 }
67 69
68 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { 70 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) {
69 if (event->type() == ui::ET_GESTURE_TAP) { 71 if (event->type() == ui::ET_GESTURE_TAP) {
70 OnExecuting(EXECUTE_SOURCE_GESTURE); 72 OnExecuting(EXECUTE_SOURCE_GESTURE);
71 command_updater_->ExecuteCommand(command_id_); 73 command_updater_->ExecuteCommand(command_id_);
72 event->SetHandled(); 74 event->SetHandled();
73 } 75 }
74 } 76 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698