OLD | NEW |
---|---|
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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/common/content_settings_types.h" | 9 #include "chrome/common/content_settings_types.h" |
10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/base/animation/animation_delegate.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 public views::WidgetObserver { | 34 public views::WidgetObserver { |
35 public: | 35 public: |
36 ContentSettingImageView(ContentSettingsType content_type, | 36 ContentSettingImageView(ContentSettingsType content_type, |
37 LocationBarView* parent, | 37 LocationBarView* parent, |
38 const gfx::Font& font, | 38 const gfx::Font& font, |
39 int font_y_offset, | 39 int font_y_offset, |
40 SkColor text_color, | 40 SkColor text_color, |
41 SkColor parent_background_color); | 41 SkColor parent_background_color); |
42 virtual ~ContentSettingImageView(); | 42 virtual ~ContentSettingImageView(); |
43 | 43 |
44 // Update the decoration from the shown WebContents. | 44 // Update the decoration from the shown WebContents. |
Peter Kasting
2013/09/05 06:55:19
Nit: While here: Function comments should be descr
npentrel
2013/09/05 08:28:09
Done.
| |
45 void Update(content::WebContents* web_contents); | 45 void UpdatePreLayout(content::WebContents* web_contents); |
46 | |
47 // Perform any updates which depend on the image having already been laid out | |
48 // by the owning LocationBarView. | |
49 void UpdatePostLayout(content::WebContents* web_contents); | |
46 | 50 |
47 private: | 51 private: |
48 // Number of milliseconds spent animating open; also the time spent animating | 52 // Number of milliseconds spent animating open; also the time spent animating |
49 // closed. | 53 // closed. |
50 static const int kOpenTimeMS; | 54 static const int kOpenTimeMS; |
51 | 55 |
52 // The total animation time, including open and close as well as an | 56 // The total animation time, including open and close as well as an |
53 // intervening "stay open" period. | 57 // intervening "stay open" period. |
54 static const int kAnimationDurationMS; | 58 static const int kAnimationDurationMS; |
55 | 59 |
(...skipping 19 matching lines...) Expand all Loading... | |
75 | 79 |
76 // views::WidgetObserver: | 80 // views::WidgetObserver: |
77 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 81 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
78 | 82 |
79 bool background_showing() const { | 83 bool background_showing() const { |
80 return slide_animator_.is_animating() || pause_animation_; | 84 return slide_animator_.is_animating() || pause_animation_; |
81 } | 85 } |
82 | 86 |
83 int GetTotalSpacingWhileAnimating() const; | 87 int GetTotalSpacingWhileAnimating() const; |
84 void OnClick(); | 88 void OnClick(); |
89 void CreateBubble(content::WebContents* web_contents); | |
85 | 90 |
86 LocationBarView* parent_; // Weak, owns us. | 91 LocationBarView* parent_; // Weak, owns us. |
87 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; | 92 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; |
88 scoped_ptr<views::Painter> background_painter_; | 93 scoped_ptr<views::Painter> background_painter_; |
89 views::ImageView* icon_; | 94 views::ImageView* icon_; |
90 views::Label* text_label_; | 95 views::Label* text_label_; |
91 ui::SlideAnimation slide_animator_; | 96 ui::SlideAnimation slide_animator_; |
92 bool pause_animation_; | 97 bool pause_animation_; |
93 double pause_animation_state_; | 98 double pause_animation_state_; |
94 views::Widget* bubble_widget_; | 99 views::Widget* bubble_widget_; |
95 | 100 |
96 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageView); | 101 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageView); |
97 }; | 102 }; |
98 | 103 |
99 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ | 104 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ |
OLD | NEW |