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

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

Issue 345183005: Ensure all members of OriginChipInfo/OriginChipView get initialized. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reupload 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 | 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_icon_image.h" 10 #include "chrome/browser/extensions/extension_icon_image.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( 84 OriginChipInfo::OriginChipInfo(extensions::IconImage::Observer* owner,
85 extensions::IconImage::Observer* owner, 85 Profile* profile)
86 Profile* profile)
87 : owner_(owner), 86 : owner_(owner),
88 profile_(profile) {} 87 profile_(profile),
88 security_level_(ToolbarModel::NONE),
89 is_url_malware_(false),
90 icon_(IDR_PRODUCT_LOGO_16) {
91 }
89 92
90 OriginChipInfo::~OriginChipInfo() {} 93 OriginChipInfo::~OriginChipInfo() {
94 }
91 95
92 bool OriginChipInfo::Update(const content::WebContents* web_contents, 96 bool OriginChipInfo::Update(const content::WebContents* web_contents,
93 const ToolbarModel* toolbar_model) { 97 const ToolbarModel* toolbar_model) {
94 GURL displayed_url = toolbar_model->GetURL(); 98 GURL displayed_url = toolbar_model->GetURL();
95 ToolbarModel::SecurityLevel security_level = 99 ToolbarModel::SecurityLevel security_level =
96 toolbar_model->GetSecurityLevel(true); 100 toolbar_model->GetSecurityLevel(true);
97 bool is_url_malware = OriginChip::IsMalware(displayed_url, web_contents); 101 bool is_url_malware = OriginChip::IsMalware(displayed_url, web_contents);
98 102
99 if ((displayed_url_ == displayed_url) && 103 if ((displayed_url_ == displayed_url) &&
100 (security_level_ == security_level) && 104 (security_level_ == security_level) &&
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 252
249 #if defined(OS_CHROMEOS) 253 #if defined(OS_CHROMEOS)
250 if (url.SchemeIs(chrome::kCrosScheme) || 254 if (url.SchemeIs(chrome::kCrosScheme) ||
251 url.SchemeIs(chrome::kDriveScheme)) 255 url.SchemeIs(chrome::kDriveScheme))
252 return base::UTF8ToUTF16(url.spec()); 256 return base::UTF8ToUTF16(url.spec());
253 #endif 257 #endif
254 258
255 // If all else fails, return the hostname. 259 // If all else fails, return the hostname.
256 return base::UTF8ToUTF16(url.host()); 260 return base::UTF8ToUTF16(url.host());
257 } 261 }
OLDNEW
« no previous file with comments | « no previous file | 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