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

Side by Side Diff: chrome/browser/ui/views/location_bar/content_setting_image_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
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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h"
12 #include "chrome/common/content_settings_types.h" 13 #include "chrome/common/content_settings_types.h"
13 #include "ui/base/animation/animation_delegate.h" 14 #include "ui/base/animation/animation_delegate.h"
14 #include "ui/views/controls/image_view.h" 15 #include "ui/views/controls/image_view.h"
15 #include "ui/views/widget/widget.h" 16 #include "ui/views/widget/widget.h"
16 17
17 class ContentSettingImageModel; 18 class ContentSettingImageModel;
18 class ContentSettingBubbleContents; 19 class ContentSettingBubbleContents;
19 class LocationBarView; 20 class LocationBarView;
20 21
21 namespace content { 22 namespace content {
22 class WebContents; 23 class WebContents;
23 } 24 }
24 25
25 namespace views { 26 namespace views {
26 class MouseEvent; 27 class MouseEvent;
27 } 28 }
28 29
29 namespace ui { 30 namespace ui {
30 class SlideAnimation; 31 class SlideAnimation;
31 } 32 }
32 33
33 class ContentSettingsDelegateView; 34 class ContentSettingsDelegateView;
34 35
35 class ContentSettingImageView : public views::ImageView, 36 class ContentSettingImageView
36 public ui::AnimationDelegate, 37 : public views::ImageView,
37 public views::Widget::Observer { 38 public ui::AnimationDelegate,
39 public views::Widget::Observer,
40 public TouchableLocationBarView {
38 public: 41 public:
39 ContentSettingImageView(ContentSettingsType content_type, 42 ContentSettingImageView(ContentSettingsType content_type,
40 LocationBarView* parent); 43 LocationBarView* parent);
41 virtual ~ContentSettingImageView(); 44 virtual ~ContentSettingImageView();
42 45
43 // |new_navigation| true if this is a new navigation, false if the tab was 46 // |new_navigation| true if this is a new navigation, false if the tab was
44 // just switched to. 47 // just switched to.
45 void UpdateFromWebContents(content::WebContents* web_contents); 48 void UpdateFromWebContents(content::WebContents* web_contents);
46 49
47 // views::View overrides: 50 // views::View overrides:
48 virtual gfx::Size GetPreferredSize() OVERRIDE; 51 virtual gfx::Size GetPreferredSize() OVERRIDE;
49 52
50 // ui::AnimationDelegate overrides: 53 // ui::AnimationDelegate overrides:
51 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; 54 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
52 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; 55 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
53 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; 56 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE;
54 57
55 // views::Widget::Observer override: 58 // views::Widget::Observer override:
56 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; 59 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
57 60
61 // TouchableLocationBarView.
62 virtual int GetBuiltInHorizontalPadding() const OVERRIDE;
63
58 private: 64 private:
59 // views::ImageView overrides: 65 // views::ImageView overrides:
60 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; 66 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
61 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; 67 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
62 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 68 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
63 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; 69 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
64 70
65 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; 71 scoped_ptr<ContentSettingImageModel> content_setting_image_model_;
66 72
67 views::Widget* bubble_widget_; 73 views::Widget* bubble_widget_;
68 74
69 // The owning LocationBarView. 75 // The owning LocationBarView.
70 LocationBarView* parent_; 76 LocationBarView* parent_;
71 77
72 scoped_ptr<ui::SlideAnimation> slide_animator_; 78 scoped_ptr<ui::SlideAnimation> slide_animator_;
73 string16 animated_text_; 79 string16 animated_text_;
74 bool pause_animation_; 80 bool pause_animation_;
75 int text_size_; 81 int text_size_;
76 int visible_text_size_; 82 int visible_text_size_;
77 gfx::Insets saved_insets_; 83 gfx::Insets saved_insets_;
78 84
79 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView); 85 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView);
80 }; 86 };
81 87
82 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 88 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698