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

Side by Side Diff: chrome/browser/page_info_model.cc

Issue 2815048: Minor clean-up tasks that were TODO(snej) (Closed)
Patch Set: Rebase on trunk prior to landing Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_host_state.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/page_info_model.h" 5 #include "chrome/browser/page_info_model.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/i18n/time_formatting.h" 11 #include "base/i18n/time_formatting.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/cert_store.h" 13 #include "chrome/browser/cert_store.h"
14 #include "chrome/browser/pref_service.h" 14 #include "chrome/browser/pref_service.h"
15 #include "chrome/browser/profile.h" 15 #include "chrome/browser/profile.h"
16 #include "chrome/browser/ssl/ssl_manager.h" 16 #include "chrome/browser/ssl/ssl_manager.h"
17 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
19 #include "net/base/cert_status_flags.h" 19 #include "net/base/cert_status_flags.h"
20 #include "net/base/x509_certificate.h" 20 #include "net/base/x509_certificate.h"
21 21
22 namespace { 22 namespace {
23 // Returns a name that can be used to represent the issuer. It tries in this 23 // Returns a name that can be used to represent the issuer. It tries in this
24 // order CN, O and OU and returns the first non-empty one found. 24 // order CN, O and OU and returns the first non-empty one found.
25 std::string GetIssuerName(const net::X509Certificate::Principal& issuer) { 25 std::string GetIssuerName(const net::CertPrincipal& issuer) {
26 if (!issuer.common_name.empty()) 26 if (!issuer.common_name.empty())
27 return issuer.common_name; 27 return issuer.common_name;
28 if (!issuer.organization_names.empty()) 28 if (!issuer.organization_names.empty())
29 return issuer.organization_names[0]; 29 return issuer.organization_names[0];
30 if (!issuer.organization_unit_names.empty()) 30 if (!issuer.organization_unit_names.empty())
31 return issuer.organization_unit_names[0]; 31 return issuer.organization_unit_names[0];
32 32
33 return std::string(); 33 return std::string();
34 } 34 }
35 } 35 }
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, 205 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY,
206 WideToUTF16(base::TimeFormatShortDate(first_visit))))); 206 WideToUTF16(base::TimeFormatShortDate(first_visit)))));
207 } 207 }
208 observer_->ModelChanged(); 208 observer_->ModelChanged();
209 } 209 }
210 210
211 // static 211 // static
212 void PageInfoModel::RegisterPrefs(PrefService* prefs) { 212 void PageInfoModel::RegisterPrefs(PrefService* prefs) {
213 prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement); 213 prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement);
214 } 214 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_host_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698