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

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

Issue 11648024: Clean-up positioning and spacing in chrome/browser/ui/views/location_bar/location_bar_view.cc (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Removed executable bit. Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ev_bubble_view.h" 5 #include "chrome/browser/ui/views/location_bar/ev_bubble_view.h"
6 6
7 EVBubbleView::EVBubbleView(const int background_images[], 7 EVBubbleView::EVBubbleView(const int background_images[],
8 int contained_image, 8 int contained_image,
9 SkColor color, 9 SkColor color,
10 LocationBarView* location_bar) 10 LocationBarView* location_bar)
11 : IconLabelBubbleView(background_images, contained_image, color), 11 : IconLabelBubbleView(background_images, contained_image, color),
12 ALLOW_THIS_IN_INITIALIZER_LIST(page_info_helper_(this, location_bar)) { 12 ALLOW_THIS_IN_INITIALIZER_LIST(page_info_helper_(this, location_bar)) {
13 SetElideInMiddle(true); 13 SetElideInMiddle(true);
14 } 14 }
15 15
16 EVBubbleView::~EVBubbleView() { 16 EVBubbleView::~EVBubbleView() {
17 } 17 }
18 18
19 gfx::Size EVBubbleView::GetMinimumSize() {
20
21 // Set the minimum size for elided EV bubbles to 150 px.
22 static const int kMinBubbleWidth = 150;
23
24 gfx::Size minimum(GetPreferredSize());
25 minimum.set_width(std::min(kMinBubbleWidth, minimum.width()));
26 return minimum;
27 }
28
19 bool EVBubbleView::OnMousePressed(const ui::MouseEvent& event) { 29 bool EVBubbleView::OnMousePressed(const ui::MouseEvent& event) {
20 // We want to show the dialog on mouse release; that is the standard behavior 30 // We want to show the dialog on mouse release; that is the standard behavior
21 // for buttons. 31 // for buttons.
22 return true; 32 return true;
23 } 33 }
24 34
25 void EVBubbleView::OnMouseReleased(const ui::MouseEvent& event) { 35 void EVBubbleView::OnMouseReleased(const ui::MouseEvent& event) {
26 page_info_helper_.ProcessEvent(event); 36 page_info_helper_.ProcessEvent(event);
27 } 37 }
28 38
29 void EVBubbleView::OnGestureEvent(ui::GestureEvent* event) { 39 void EVBubbleView::OnGestureEvent(ui::GestureEvent* event) {
30 if (event->type() == ui::ET_GESTURE_TAP) { 40 if (event->type() == ui::ET_GESTURE_TAP) {
31 page_info_helper_.ProcessEvent(*event); 41 page_info_helper_.ProcessEvent(*event);
32 event->SetHandled(); 42 event->SetHandled();
33 } 43 }
34 } 44 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/ev_bubble_view.h ('k') | chrome/browser/ui/views/location_bar/location_bar_layout.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698