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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 1123943002: Move SecurityLevel into a class of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting nits Created 5 years, 7 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/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 9a8e18a9dcdc05378ab4974e4dca8414ffcf92fa..5a90ba753d9d959e64fcb503f0b34ee4df6cf183 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -211,9 +211,9 @@ void LocationBarView::Init() {
location_height - bubble_vertical_padding));
const SkColor background_color =
- GetColor(ToolbarModel::NONE, LocationBarView::BACKGROUND);
+ GetColor(SecurityLevelPolicy::NONE, LocationBarView::BACKGROUND);
ev_bubble_view_ = new EVBubbleView(
- bubble_font_list, GetColor(ToolbarModel::EV_SECURE, SECURITY_TEXT),
+ bubble_font_list, GetColor(SecurityLevelPolicy::EV_SECURE, SECURITY_TEXT),
background_color, this);
ev_bubble_view_->set_drag_controller(this);
AddChildView(ev_bubble_view_);
@@ -239,7 +239,7 @@ void LocationBarView::Init() {
ime_inline_autocomplete_view_->SetVisible(false);
AddChildView(ime_inline_autocomplete_view_);
- const SkColor text_color = GetColor(ToolbarModel::NONE, TEXT);
+ const SkColor text_color = GetColor(SecurityLevelPolicy::NONE, TEXT);
selected_keyword_view_ = new SelectedKeywordView(
bubble_font_list, text_color, background_color, profile());
AddChildView(selected_keyword_view_);
@@ -247,14 +247,14 @@ void LocationBarView::Init() {
suggested_text_view_ = new views::Label(base::string16(), font_list);
suggested_text_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
suggested_text_view_->SetAutoColorReadabilityEnabled(false);
- suggested_text_view_->SetEnabledColor(GetColor(
- ToolbarModel::NONE, LocationBarView::DEEMPHASIZED_TEXT));
+ suggested_text_view_->SetEnabledColor(
+ GetColor(SecurityLevelPolicy::NONE, LocationBarView::DEEMPHASIZED_TEXT));
suggested_text_view_->SetVisible(false);
AddChildView(suggested_text_view_);
keyword_hint_view_ = new KeywordHintView(
profile(), font_list,
- GetColor(ToolbarModel::NONE, LocationBarView::DEEMPHASIZED_TEXT),
+ GetColor(SecurityLevelPolicy::NONE, LocationBarView::DEEMPHASIZED_TEXT),
background_color);
AddChildView(keyword_hint_view_);
@@ -313,8 +313,9 @@ bool LocationBarView::IsInitialized() const {
return omnibox_view_ != NULL;
}
-SkColor LocationBarView::GetColor(ToolbarModel::SecurityLevel security_level,
- ColorKind kind) const {
+SkColor LocationBarView::GetColor(
+ SecurityLevelPolicy::SecurityLevel security_level,
+ ColorKind kind) const {
const ui::NativeTheme* native_theme = GetNativeTheme();
switch (kind) {
case BACKGROUND:
@@ -338,17 +339,17 @@ SkColor LocationBarView::GetColor(ToolbarModel::SecurityLevel security_level,
case SECURITY_TEXT: {
SkColor color;
switch (security_level) {
- case ToolbarModel::EV_SECURE:
- case ToolbarModel::SECURE:
+ case SecurityLevelPolicy::EV_SECURE:
+ case SecurityLevelPolicy::SECURE:
color = SkColorSetRGB(7, 149, 0);
break;
- case ToolbarModel::SECURITY_WARNING:
- case ToolbarModel::SECURITY_POLICY_WARNING:
+ case SecurityLevelPolicy::SECURITY_WARNING:
+ case SecurityLevelPolicy::SECURITY_POLICY_WARNING:
return GetColor(security_level, DEEMPHASIZED_TEXT);
break;
- case ToolbarModel::SECURITY_ERROR:
+ case SecurityLevelPolicy::SECURITY_ERROR:
color = SkColorSetRGB(162, 0, 0);
break;
@@ -998,8 +999,8 @@ bool LocationBarView::ShouldShowKeywordBubble() const {
}
bool LocationBarView::ShouldShowEVBubble() const {
- return
- (GetToolbarModel()->GetSecurityLevel(false) == ToolbarModel::EV_SECURE);
+ return (GetToolbarModel()->GetSecurityLevel(false) ==
+ SecurityLevelPolicy::EV_SECURE);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1220,7 +1221,7 @@ void LocationBarView::OnPaint(gfx::Canvas* canvas) {
// the omnibox background, so we can't just blindly fill our entire bounds.
gfx::Rect bounds(GetContentsBounds());
bounds.Inset(GetHorizontalEdgeThickness(), vertical_edge_thickness());
- SkColor color(GetColor(ToolbarModel::NONE, BACKGROUND));
+ SkColor color(GetColor(SecurityLevelPolicy::NONE, BACKGROUND));
if (is_popup_mode_) {
canvas->FillRect(bounds, color);
} else {

Powered by Google App Engine
This is Rietveld 408576698