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

Side by Side Diff: trunk/src/chrome/browser/ui/toolbar/origin_chip_info.cc

Issue 341313004: Revert 278845 "Ensure all members of OriginChipInfo/OriginChipVi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | trunk/src/chrome/browser/ui/views/location_bar/origin_chip_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "chrome/browser/ui/toolbar/origin_chip_info.h" 5 #include "chrome/browser/ui/toolbar/origin_chip_info.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (host == chrome::kChromeUISettingsHost) 74 if (host == chrome::kChromeUISettingsHost)
75 return IDS_SETTINGS_TITLE; 75 return IDS_SETTINGS_TITLE;
76 if (host == chrome::kChromeUIVersionHost) 76 if (host == chrome::kChromeUIVersionHost)
77 return IDS_ABOUT_VERSION_TITLE; 77 return IDS_ABOUT_VERSION_TITLE;
78 78
79 return -1; 79 return -1;
80 } 80 }
81 81
82 } // namespace 82 } // namespace
83 83
84 OriginChipInfo::OriginChipInfo(extensions::IconImage::Observer* owner, 84 OriginChipInfo::OriginChipInfo(
85 Profile* profile) 85 extensions::IconImage::Observer* owner,
86 Profile* profile)
86 : owner_(owner), 87 : owner_(owner),
87 profile_(profile), 88 profile_(profile) {}
88 security_level_(ToolbarModel::NONE),
89 is_url_malware_(false),
90 icon_(IDR_PRODUCT_LOGO_16) {
91 }
92 89
93 OriginChipInfo::~OriginChipInfo() { 90 OriginChipInfo::~OriginChipInfo() {}
94 }
95 91
96 bool OriginChipInfo::Update(const content::WebContents* web_contents, 92 bool OriginChipInfo::Update(const content::WebContents* web_contents,
97 const ToolbarModel* toolbar_model) { 93 const ToolbarModel* toolbar_model) {
98 GURL displayed_url = toolbar_model->GetURL(); 94 GURL displayed_url = toolbar_model->GetURL();
99 ToolbarModel::SecurityLevel security_level = 95 ToolbarModel::SecurityLevel security_level =
100 toolbar_model->GetSecurityLevel(true); 96 toolbar_model->GetSecurityLevel(true);
101 bool is_url_malware = OriginChip::IsMalware(displayed_url, web_contents); 97 bool is_url_malware = OriginChip::IsMalware(displayed_url, web_contents);
102 98
103 if ((displayed_url_ == displayed_url) && 99 if ((displayed_url_ == displayed_url) &&
104 (security_level_ == security_level) && 100 (security_level_ == security_level) &&
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 248
253 #if defined(OS_CHROMEOS) 249 #if defined(OS_CHROMEOS)
254 if (url.SchemeIs(chrome::kCrosScheme) || 250 if (url.SchemeIs(chrome::kCrosScheme) ||
255 url.SchemeIs(chrome::kDriveScheme)) 251 url.SchemeIs(chrome::kDriveScheme))
256 return base::UTF8ToUTF16(url.spec()); 252 return base::UTF8ToUTF16(url.spec());
257 #endif 253 #endif
258 254
259 // If all else fails, return the hostname. 255 // If all else fails, return the hostname.
260 return base::UTF8ToUTF16(url.host()); 256 return base::UTF8ToUTF16(url.host());
261 } 257 }
OLDNEW
« no previous file with comments | « no previous file | trunk/src/chrome/browser/ui/views/location_bar/origin_chip_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698