| 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/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 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 // The ContentSettingImageView displays an icon and optional text label for | 36 // The ContentSettingImageView displays an icon and optional text label for |
| 37 // various content settings affordances in the location bar (i.e. plugin | 37 // various content settings affordances in the location bar (i.e. plugin |
| 38 // blocking, geolocation). | 38 // blocking, geolocation). |
| 39 class ContentSettingImageView : public LocationBarDecorationView, | 39 class ContentSettingImageView : public LocationBarDecorationView, |
| 40 public views::WidgetObserver { | 40 public views::WidgetObserver { |
| 41 public: | 41 public: |
| 42 ContentSettingImageView(ContentSettingsType content_type, | 42 ContentSettingImageView(ContentSettingsType content_type, |
| 43 const int background_images[], | 43 const int background_images[], |
| 44 LocationBarView* parent); | 44 LocationBarView* parent, |
| 45 const gfx::Font& font, |
| 46 SkColor font_color); |
| 45 virtual ~ContentSettingImageView(); | 47 virtual ~ContentSettingImageView(); |
| 46 | 48 |
| 47 virtual void Update(TabContents* tab_contents) OVERRIDE; | 49 virtual void Update(TabContents* tab_contents) OVERRIDE; |
| 48 | 50 |
| 49 | 51 |
| 50 // views::WidgetObserver override: | 52 // views::WidgetObserver override: |
| 51 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 53 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 52 | 54 |
| 53 protected: | 55 protected: |
| 54 // Invoked when the user clicks on the control. | 56 // Invoked when the user clicks on the control. |
| 55 virtual void OnClick(LocationBarView* parent) OVERRIDE; | 57 virtual void OnClick(LocationBarView* parent) OVERRIDE; |
| 56 virtual int GetTextAnimationSize(double state, int text_size) OVERRIDE; | 58 virtual int GetTextAnimationSize(double state, int text_size) OVERRIDE; |
| 57 | 59 |
| 58 private: | 60 private: |
| 59 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; | 61 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; |
| 60 | 62 |
| 61 views::Widget* bubble_widget_; | 63 views::Widget* bubble_widget_; |
| 62 | 64 |
| 63 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView); | 65 DISALLOW_IMPLICIT_CONSTRUCTORS(ContentSettingImageView); |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ | 68 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CONTENT_SETTING_IMAGE_VIEW_H_ |
| OLD | NEW |