| 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 #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_ |
| OLD | NEW |