| 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/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // This model provides data (icon ids and tooltip) for the content setting icons | 24 // This model provides data (icon ids and tooltip) for the content setting icons |
| 25 // that are displayed in the location bar. | 25 // that are displayed in the location bar. |
| 26 class ContentSettingImageModel { | 26 class ContentSettingImageModel { |
| 27 public: | 27 public: |
| 28 virtual ~ContentSettingImageModel() {} | 28 virtual ~ContentSettingImageModel() {} |
| 29 | 29 |
| 30 // Generates a vector of all image models to be used within one window. | 30 // Generates a vector of all image models to be used within one window. |
| 31 static std::vector<std::unique_ptr<ContentSettingImageModel>> | 31 static std::vector<std::unique_ptr<ContentSettingImageModel>> |
| 32 GenerateContentSettingImageModels(); | 32 GenerateContentSettingImageModels(); |
| 33 | 33 |
| 34 // Returns the corresponding index into the above vector for the given |
| 35 // ContentSettingsType. For testing. |
| 36 static size_t GetContentSettingImageModelIndexForTesting( |
| 37 ContentSettingsType content_type); |
| 38 |
| 34 // Notifies this model that its setting might have changed and it may need to | 39 // Notifies this model that its setting might have changed and it may need to |
| 35 // update its visibility, icon and tooltip. | 40 // update its visibility, icon and tooltip. |
| 36 virtual void UpdateFromWebContents(content::WebContents* web_contents) = 0; | 41 virtual void UpdateFromWebContents(content::WebContents* web_contents) = 0; |
| 37 | 42 |
| 38 // Creates the model for the bubble that will be attached to this image. | 43 // Creates the model for the bubble that will be attached to this image. |
| 39 // The bubble model is owned by the caller. | 44 // The bubble model is owned by the caller. |
| 40 virtual ContentSettingBubbleModel* CreateBubbleModel( | 45 virtual ContentSettingBubbleModel* CreateBubbleModel( |
| 41 ContentSettingBubbleModel::Delegate* delegate, | 46 ContentSettingBubbleModel::Delegate* delegate, |
| 42 content::WebContents* web_contents, | 47 content::WebContents* web_contents, |
| 43 Profile* profile) = 0; | 48 Profile* profile) = 0; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 Profile* profile) override; | 134 Profile* profile) override; |
| 130 | 135 |
| 131 bool ShouldRunAnimation(content::WebContents* web_contents) override; | 136 bool ShouldRunAnimation(content::WebContents* web_contents) override; |
| 132 void SetAnimationHasRun(content::WebContents* web_contents) override; | 137 void SetAnimationHasRun(content::WebContents* web_contents) override; |
| 133 | 138 |
| 134 private: | 139 private: |
| 135 DISALLOW_COPY_AND_ASSIGN(ContentSettingSubresourceFilterImageModel); | 140 DISALLOW_COPY_AND_ASSIGN(ContentSettingSubresourceFilterImageModel); |
| 136 }; | 141 }; |
| 137 | 142 |
| 138 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ | 143 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ |
| OLD | NEW |