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

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

Issue 10519008: Enlarge size of touch target for several location bar buttons without affecting visual layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge to LKGR Created 8 years, 6 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 (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/location_icon_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/generated_resources.h" 8 #include "grit/generated_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 10
11 LocationIconView::LocationIconView(LocationBarView* location_bar) 11 LocationIconView::LocationIconView(LocationBarView* location_bar)
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 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON)); 13 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON));
14 TouchableLocationBarView::Init(this);
14 } 15 }
15 16
16 LocationIconView::~LocationIconView() { 17 LocationIconView::~LocationIconView() {
17 } 18 }
18 19
19 bool LocationIconView::OnMousePressed(const views::MouseEvent& event) { 20 bool LocationIconView::OnMousePressed(const views::MouseEvent& event) {
20 // We want to show the dialog on mouse release; that is the standard behavior 21 // We want to show the dialog on mouse release; that is the standard behavior
21 // for buttons. 22 // for buttons.
22 return true; 23 return true;
23 } 24 }
24 25
25 void LocationIconView::OnMouseReleased(const views::MouseEvent& event) { 26 void LocationIconView::OnMouseReleased(const views::MouseEvent& event) {
26 page_info_helper_.ProcessEvent(event); 27 page_info_helper_.ProcessEvent(event);
27 } 28 }
28 29
29 ui::GestureStatus LocationIconView::OnGestureEvent( 30 ui::GestureStatus LocationIconView::OnGestureEvent(
30 const views::GestureEvent& event) { 31 const views::GestureEvent& event) {
31 if (event.type() == ui::ET_GESTURE_TAP) { 32 if (event.type() == ui::ET_GESTURE_TAP) {
32 page_info_helper_.ProcessEvent(event); 33 page_info_helper_.ProcessEvent(event);
33 return ui::GESTURE_STATUS_CONSUMED; 34 return ui::GESTURE_STATUS_CONSUMED;
34 } 35 }
35 return ui::GESTURE_STATUS_UNKNOWN; 36 return ui::GESTURE_STATUS_UNKNOWN;
36 } 37 }
37 38
39 int LocationIconView::GetBuiltInHorizontalPadding() const {
40 return GetBuiltInHorizontalPaddingImpl();
41 }
42
38 void LocationIconView::ShowTooltip(bool show) { 43 void LocationIconView::ShowTooltip(bool show) {
39 if (show) { 44 if (show) {
40 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON)); 45 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON));
41 } else { 46 } else {
42 SetTooltipText(string16()); 47 SetTooltipText(string16());
43 } 48 }
44 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698