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

Unified Diff: chrome/browser/ui/views/location_bar/touchable_location_bar_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: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/location_bar/touchable_location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/touchable_location_bar_view.cc b/chrome/browser/ui/views/location_bar/touchable_location_bar_view.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dff32e489436436242fee6ed43bda8c5e57eb728
--- /dev/null
+++ b/chrome/browser/ui/views/location_bar/touchable_location_bar_view.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h"
+
+#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
+#include "ui/base/layout.h"
+#include "ui/views/border.h"
+
+void TouchableLocationBarViewBase::Init() {
+ if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) {
+ SetBorder(3, touch_horizontal_padding());
+ }
+}
+
+int TouchableLocationBarViewBase::GetBuiltInHorizontalPadding() const {
+ return ui::GetDisplayLayout() == ui::LAYOUT_TOUCH ?
+ touch_horizontal_padding() : 0;
+}
+
+int TouchableLocationBarViewBase::touch_horizontal_padding() const {
+ return LocationBarView::GetItemPadding() / 2;
+}

Powered by Google App Engine
This is Rietveld 408576698