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

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

Issue 10821114: Refactor the content setting view to allow a subclass for the web intents button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 26 matching lines...) Expand all
37 public ui::AnimationDelegate, 37 public ui::AnimationDelegate,
38 public views::Widget::Observer, 38 public views::Widget::Observer,
39 public TouchableLocationBarView { 39 public TouchableLocationBarView {
40 public: 40 public:
41 ContentSettingImageView(ContentSettingsType content_type, 41 ContentSettingImageView(ContentSettingsType content_type,
42 LocationBarView* parent); 42 LocationBarView* parent);
43 virtual ~ContentSettingImageView(); 43 virtual ~ContentSettingImageView();
44 44
45 // |new_navigation| true if this is a new navigation, false if the tab was 45 // |new_navigation| true if this is a new navigation, false if the tab was
46 // just switched to. 46 // just switched to.
47 void UpdateFromWebContents(content::WebContents* web_contents); 47 void Update(TabContents* tab_contents);
48 48
49 // views::View overrides: 49 // views::View overrides:
50 virtual gfx::Size GetPreferredSize() OVERRIDE; 50 virtual gfx::Size GetPreferredSize() OVERRIDE;
51 51
52 // ui::AnimationDelegate overrides: 52 // ui::AnimationDelegate overrides:
53 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; 53 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
54 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; 54 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
55 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; 55 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE;
56 56
57 // views::Widget::Observer override: 57 // views::Widget::Observer override:
58 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; 58 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;
59 59
60 // TouchableLocationBarView. 60 // TouchableLocationBarView.
61 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; 61 virtual int GetBuiltInHorizontalPadding() const OVERRIDE;
62 62
63 protected:
64 virtual SkColor button_border_color() const;
65 virtual SkColor gradient_top_color() const;
66 virtual SkColor gradient_bottom_color() const;
67 virtual void OnClick();
68
63 private: 69 private:
64 // views::ImageView overrides: 70 // views::ImageView overrides:
65 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; 71 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
66 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; 72 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
67 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 73 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
68 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; 74 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
69 75
70 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; 76 scoped_ptr<ContentSettingImageModel> content_setting_image_model_;
71 77
72 views::Widget* bubble_widget_; 78 views::Widget* bubble_widget_;
73 79
74 // The owning LocationBarView. 80 // The owning LocationBarView.
75 LocationBarView* parent_; 81 LocationBarView* parent_;
76 82
77 scoped_ptr<ui::SlideAnimation> slide_animator_; 83 scoped_ptr<ui::SlideAnimation> slide_animator_;
78 string16 animated_text_; 84 string16 animated_text_;
79 bool pause_animation_; 85 bool pause_animation_;
80 int text_size_; 86 int text_size_;
81 int visible_text_size_; 87 int visible_text_size_;
82 gfx::Insets saved_insets_; 88 gfx::Insets saved_insets_;
83 89
84 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView); 90 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView);
85 }; 91 };
86 92
87 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ 93 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698