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