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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 int explanatory_string_id() const { return explanatory_string_id_; } | 46 int explanatory_string_id() const { return explanatory_string_id_; } |
47 std::string get_tooltip() const { return tooltip_; } | 47 std::string get_tooltip() const { return tooltip_; } |
48 | 48 |
49 protected: | 49 protected: |
50 explicit ContentSettingImageModel(ContentSettingsType content_settings_type); | 50 explicit ContentSettingImageModel(ContentSettingsType content_settings_type); |
51 void SetIconByResourceId(int id); | 51 void SetIconByResourceId(int id); |
52 #if !defined(OS_MACOSX) | 52 #if !defined(OS_MACOSX) |
53 void SetIconByVectorId(gfx::VectorIconId id, bool blocked); | 53 void SetIconByVectorId(gfx::VectorIconId id, bool blocked); |
54 #endif | 54 #endif |
55 void set_visible(bool visible) { is_visible_ = visible; } | 55 void set_visible(bool visible) { is_visible_ = visible; } |
| 56 void set_icon(const gfx::Image& image) { icon_ = image; } |
56 void set_explanatory_string_id(int text_id) { | 57 void set_explanatory_string_id(int text_id) { |
57 explanatory_string_id_ = text_id; | 58 explanatory_string_id_ = text_id; |
58 } | 59 } |
59 void set_tooltip(const std::string& tooltip) { tooltip_ = tooltip; } | 60 void set_tooltip(const std::string& tooltip) { tooltip_ = tooltip; } |
60 | 61 |
61 private: | 62 private: |
62 const ContentSettingsType content_settings_type_; | 63 const ContentSettingsType content_settings_type_; |
63 bool is_visible_; | 64 bool is_visible_; |
64 int icon_id_; | 65 int icon_id_; |
65 gfx::Image icon_; | 66 gfx::Image icon_; |
66 int explanatory_string_id_; | 67 int explanatory_string_id_; |
67 std::string tooltip_; | 68 std::string tooltip_; |
68 | 69 |
69 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageModel); | 70 DISALLOW_COPY_AND_ASSIGN(ContentSettingImageModel); |
70 }; | 71 }; |
71 | 72 |
72 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ | 73 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_IMAGE_MODEL_H_ |
OLD | NEW |