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

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

Issue 1314843007: Refactor connection_security into SecurityStateModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: create SecurityStateModel for chromeos login webview Created 5 years, 3 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 c406984ac013f68ba01e7aa9e4d43befdc11b6d1..1b3b6b5c99543626281b9358ac7cadb8c3aaf8c2 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -222,9 +222,9 @@ void LocationBarView::Init() {
location_height - bubble_vertical_padding));
const SkColor background_color =
- GetColor(connection_security::NONE, LocationBarView::BACKGROUND);
+ GetColor(SecurityStateModel::NONE, LocationBarView::BACKGROUND);
ev_bubble_view_ = new EVBubbleView(
- bubble_font_list, GetColor(connection_security::EV_SECURE, SECURITY_TEXT),
+ bubble_font_list, GetColor(SecurityStateModel::EV_SECURE, SECURITY_TEXT),
background_color, this);
ev_bubble_view_->set_drag_controller(this);
AddChildView(ev_bubble_view_);
@@ -250,7 +250,7 @@ void LocationBarView::Init() {
ime_inline_autocomplete_view_->SetVisible(false);
AddChildView(ime_inline_autocomplete_view_);
- const SkColor text_color = GetColor(connection_security::NONE, TEXT);
+ const SkColor text_color = GetColor(SecurityStateModel::NONE, TEXT);
selected_keyword_view_ = new SelectedKeywordView(
bubble_font_list, text_color, background_color, profile());
AddChildView(selected_keyword_view_);
@@ -259,13 +259,13 @@ void LocationBarView::Init() {
suggested_text_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
suggested_text_view_->SetAutoColorReadabilityEnabled(false);
suggested_text_view_->SetEnabledColor(
- GetColor(connection_security::NONE, LocationBarView::DEEMPHASIZED_TEXT));
+ GetColor(SecurityStateModel::NONE, LocationBarView::DEEMPHASIZED_TEXT));
suggested_text_view_->SetVisible(false);
AddChildView(suggested_text_view_);
keyword_hint_view_ = new KeywordHintView(
profile(), font_list,
- GetColor(connection_security::NONE, LocationBarView::DEEMPHASIZED_TEXT),
+ GetColor(SecurityStateModel::NONE, LocationBarView::DEEMPHASIZED_TEXT),
background_color);
AddChildView(keyword_hint_view_);
@@ -322,7 +322,7 @@ bool LocationBarView::IsInitialized() const {
}
SkColor LocationBarView::GetColor(
- connection_security::SecurityLevel security_level,
+ SecurityStateModel::SecurityLevel security_level,
ColorKind kind) const {
const ui::NativeTheme* native_theme = GetNativeTheme();
switch (kind) {
@@ -347,20 +347,20 @@ SkColor LocationBarView::GetColor(
case SECURITY_TEXT: {
SkColor color;
switch (security_level) {
- case connection_security::EV_SECURE:
- case connection_security::SECURE:
+ case SecurityStateModel::EV_SECURE:
+ case SecurityStateModel::SECURE:
color = SkColorSetRGB(7, 149, 0);
break;
- case connection_security::SECURITY_POLICY_WARNING:
+ case SecurityStateModel::SECURITY_POLICY_WARNING:
return GetColor(security_level, DEEMPHASIZED_TEXT);
break;
- case connection_security::SECURITY_ERROR:
+ case SecurityStateModel::SECURITY_ERROR:
color = SkColorSetRGB(162, 0, 0);
break;
- case connection_security::SECURITY_WARNING:
+ case SecurityStateModel::SECURITY_WARNING:
return GetColor(security_level, TEXT);
break;
@@ -1048,7 +1048,7 @@ bool LocationBarView::ShouldShowEVBubble() const {
const ChromeToolbarModel* chrome_toolbar_model =
static_cast<const ChromeToolbarModel*>(GetToolbarModel());
return (chrome_toolbar_model->GetSecurityLevel(false) ==
- connection_security::EV_SECURE);
+ SecurityStateModel::EV_SECURE);
}
////////////////////////////////////////////////////////////////////////////////
@@ -1263,7 +1263,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(), GetVerticalEdgeThickness());
- SkColor color(GetColor(connection_security::NONE, BACKGROUND));
+ SkColor color(GetColor(SecurityStateModel::NONE, BACKGROUND));
if (is_popup_mode_) {
canvas->FillRect(bounds, color);
} else {
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_view_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698