| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ | 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Whether the animation should be run for the given |web_contents|. | 46 // Whether the animation should be run for the given |web_contents|. |
| 47 virtual bool ShouldRunAnimation(content::WebContents* web_contents) = 0; | 47 virtual bool ShouldRunAnimation(content::WebContents* web_contents) = 0; |
| 48 | 48 |
| 49 // Remembers that the animation has already run for the given |web_contents|, | 49 // Remembers that the animation has already run for the given |web_contents|, |
| 50 // so that we do not restart it when the parent view is updated. | 50 // so that we do not restart it when the parent view is updated. |
| 51 virtual void SetAnimationHasRun(content::WebContents* web_contents) = 0; | 51 virtual void SetAnimationHasRun(content::WebContents* web_contents) = 0; |
| 52 | 52 |
| 53 bool is_visible() const { return is_visible_; } | 53 bool is_visible() const { return is_visible_; } |
| 54 | 54 |
| 55 #if defined(OS_MACOSX) | 55 #if defined(OS_MACOSX) |
| 56 const gfx::Image& raster_icon() const { return raster_icon_; } | 56 // Calls UpdateFromWebContents() and returns true if the icon has changed. |
| 57 int raster_icon_id() const { return raster_icon_id_; } | 57 bool UpdateFromWebContentsAndCheckIfIconChanged( |
| 58 content::WebContents* web_contents); |
| 58 #endif | 59 #endif |
| 59 | 60 |
| 60 gfx::Image GetIcon(SkColor nearby_text_color) const; | 61 gfx::Image GetIcon(SkColor nearby_text_color) const; |
| 61 | 62 |
| 62 // Returns the resource ID of a string to show when the icon appears, or 0 if | 63 // Returns the resource ID of a string to show when the icon appears, or 0 if |
| 63 // we don't wish to show anything. | 64 // we don't wish to show anything. |
| 64 int explanatory_string_id() const { return explanatory_string_id_; } | 65 int explanatory_string_id() const { return explanatory_string_id_; } |
| 65 const base::string16& get_tooltip() const { return tooltip_; } | 66 const base::string16& get_tooltip() const { return tooltip_; } |
| 66 | 67 |
| 67 protected: | 68 protected: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 protected: | 116 protected: |
| 116 ContentSettingsType content_type() { return content_type_; } | 117 ContentSettingsType content_type() { return content_type_; } |
| 117 | 118 |
| 118 private: | 119 private: |
| 119 ContentSettingsType content_type_; | 120 ContentSettingsType content_type_; |
| 120 | 121 |
| 121 DISALLOW_COPY_AND_ASSIGN(ContentSettingSimpleImageModel); | 122 DISALLOW_COPY_AND_ASSIGN(ContentSettingSimpleImageModel); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ | 125 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ |
| OLD | NEW |