Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2165)

Unified Diff: chrome/browser/ui/content_settings/content_setting_image_model.h

Issue 1313603003: Vectorize website settings icons in omnibox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change DCHECK Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/content_settings/content_setting_image_model.h
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.h b/chrome/browser/ui/content_settings/content_setting_image_model.h
index b1c04af788b8a9f3de34daaf7f882203e34f31f2..459e429929e0b3e7db2495a6d905d1cf85d2e75d 100644
--- a/chrome/browser/ui/content_settings/content_setting_image_model.h
+++ b/chrome/browser/ui/content_settings/content_setting_image_model.h
@@ -9,11 +9,16 @@
#include "base/basictypes.h"
#include "components/content_settings/core/common/content_settings_types.h"
+#include "ui/gfx/image/image.h"
namespace content {
class WebContents;
}
+namespace gfx {
+enum class VectorIconId;
+}
+
// This model provides data (icon ids and tooltip) for the content setting icons
// that are displayed in the location bar.
class ContentSettingImageModel {
@@ -32,7 +37,10 @@ class ContentSettingImageModel {
return content_settings_type_;
}
bool is_visible() const { return is_visible_; }
- int get_icon() const { return icon_; }
+ const gfx::Image& icon() const { return icon_; }
+#if defined(OS_MACOSX)
+ int icon_id() const { return icon_id_; }
+#endif
// Returns the resource ID of a string to show when the icon appears, or 0 if
// we don't wish to show anything.
int explanatory_string_id() const { return explanatory_string_id_; }
@@ -40,8 +48,11 @@ class ContentSettingImageModel {
protected:
explicit ContentSettingImageModel(ContentSettingsType content_settings_type);
+ void SetIconByResourceId(int id);
+#if !defined(OS_MACOSX)
+ void SetIconByVectorId(gfx::VectorIconId id, bool blocked);
+#endif
void set_visible(bool visible) { is_visible_ = visible; }
- void set_icon(int icon) { icon_ = icon; }
void set_explanatory_string_id(int text_id) {
explanatory_string_id_ = text_id;
}
@@ -50,7 +61,8 @@ class ContentSettingImageModel {
private:
const ContentSettingsType content_settings_type_;
bool is_visible_;
- int icon_;
+ int icon_id_;
+ gfx::Image icon_;
int explanatory_string_id_;
std::string tooltip_;

Powered by Google App Engine
This is Rietveld 408576698