| 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/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
| 11 #include "ui/gfx/animation/slide_animation.h" | 11 #include "ui/gfx/animation/slide_animation.h" |
| 12 #include "ui/gfx/font.h" | |
| 13 #include "ui/views/painter.h" | 12 #include "ui/views/painter.h" |
| 14 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 15 #include "ui/views/widget/widget_observer.h" | 14 #include "ui/views/widget/widget_observer.h" |
| 16 | 15 |
| 17 class ContentSettingImageModel; | 16 class ContentSettingImageModel; |
| 18 class LocationBarView; | 17 class LocationBarView; |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 class WebContents; | 20 class WebContents; |
| 22 } | 21 } |
| 23 | 22 |
| 23 namespace gfx { |
| 24 class FontList; |
| 25 } |
| 26 |
| 24 namespace views { | 27 namespace views { |
| 25 class ImageView; | 28 class ImageView; |
| 26 class Label; | 29 class Label; |
| 27 } | 30 } |
| 28 | 31 |
| 29 // The ContentSettingImageView displays an icon and optional text label for | 32 // The ContentSettingImageView displays an icon and optional text label for |
| 30 // various content settings affordances in the location bar (i.e. plugin | 33 // various content settings affordances in the location bar (i.e. plugin |
| 31 // blocking, geolocation). | 34 // blocking, geolocation). |
| 32 class ContentSettingImageView : public gfx::AnimationDelegate, | 35 class ContentSettingImageView : public gfx::AnimationDelegate, |
| 33 public views::View, | 36 public views::View, |
| 34 public views::WidgetObserver { | 37 public views::WidgetObserver { |
| 35 public: | 38 public: |
| 36 ContentSettingImageView(ContentSettingsType content_type, | 39 ContentSettingImageView(ContentSettingsType content_type, |
| 37 LocationBarView* parent, | 40 LocationBarView* parent, |
| 38 const gfx::Font& font, | 41 const gfx::FontList& font_list, |
| 39 int font_y_offset, | 42 int font_y_offset, |
| 40 SkColor text_color, | 43 SkColor text_color, |
| 41 SkColor parent_background_color); | 44 SkColor parent_background_color); |
| 42 virtual ~ContentSettingImageView(); | 45 virtual ~ContentSettingImageView(); |
| 43 | 46 |
| 44 // Updates the decoration from the shown WebContents. | 47 // Updates the decoration from the shown WebContents. |
| 45 void UpdatePreLayout(content::WebContents* web_contents); | 48 void UpdatePreLayout(content::WebContents* web_contents); |
| 46 | 49 |
| 47 // Performs any updates which depend on the image having already been laid out | 50 // Performs any updates which depend on the image having already been laid out |
| 48 // by the owning LocationBarView. | 51 // by the owning LocationBarView. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 views::Label* text_label_; | 98 views::Label* text_label_; |
| 96 gfx::SlideAnimation slide_animator_; | 99 gfx::SlideAnimation slide_animator_; |
| 97 bool pause_animation_; | 100 bool pause_animation_; |
| 98 double pause_animation_state_; | 101 double pause_animation_state_; |
| 99 views::Widget* bubble_widget_; | 102 views::Widget* bubble_widget_; |
| 100 | 103 |
| 101 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageView); | 104 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageView); |
| 102 }; | 105 }; |
| 103 | 106 |
| 104 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ | 107 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ |
| OLD | NEW |