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

Side by Side Diff: chrome/browser/ui/views/location_bar/touchable_location_bar_view.h

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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_TOUCHABLE_LOCATION_BAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_TOUCHABLE_LOCATION_BAR_VIEW_H_
7 #pragma once
8
9 #include "ui/views/view.h"
10
11 // An interface for a View in within the LocationBar that knows how to
12 // increase its size (without affecting visual layout) in a touch
13 // layout, to increase the size of the touch target. Its border
14 // extends a few pixels up and down, which doesn't affect layout, and
15 // extends half of the padding used between items in the location bar
16 // to the left and right.
17 //
18 // To make your location bar View extend itself into the padding
19 // around it to get an enlarged touch target, inherit from
20 // TouchableLocationBarView interface, implement its
21 // GetBuiltInHorizontalPadding method by calling
22 // GetBuiltInHorizontalPaddingImpl, and call
23 // TouchableLocationBarView::Init() from your constructor.
24 class TouchableLocationBarView {
25 public:
26 // Returns the number of pixels of built-in padding to the left and
27 // right of the image for this view.
28 virtual int GetBuiltInHorizontalPadding() const = 0;
29
30 protected:
31 // Call this from the constructor (or during early initialization)
32 // of a class that inherits from TouchableLocationBarView.
33 static void Init(views::View* view);
34
35 // Use this to implement GetBuiltInHorizontalPadding().
36 static int GetBuiltInHorizontalPaddingImpl();
37 };
38
39 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_TOUCHABLE_LOCATION_BAR_VIEW_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/star_view.cc ('k') | chrome/browser/ui/views/location_bar/touchable_location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698