| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/i18n/time_formatting.h" | 12 #include "base/i18n/time_formatting.h" |
| 13 #include "base/string16.h" |
| 13 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 14 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/page_info_model_observer.h" | 16 #include "chrome/browser/page_info_model_observer.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/ssl/ssl_error_info.h" | 18 #include "chrome/browser/ssl/ssl_error_info.h" |
| 18 #include "content/browser/cert_store.h" | 19 #include "content/browser/cert_store.h" |
| 19 #include "content/browser/ssl/ssl_manager.h" | 20 #include "content/browser/ssl/ssl_manager.h" |
| 20 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
| 21 #include "grit/chromium_strings.h" | 22 #include "grit/chromium_strings.h" |
| 22 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 23 #include "grit/theme_resources.h" | 24 #include "grit/theme_resources.h" |
| 24 #include "net/base/cert_status_flags.h" | 25 #include "net/base/cert_status_flags.h" |
| 25 #include "net/base/ssl_cipher_suite_names.h" | 26 #include "net/base/ssl_cipher_suite_names.h" |
| 26 #include "net/base/ssl_connection_status_flags.h" | 27 #include "net/base/ssl_connection_status_flags.h" |
| 27 #include "net/base/x509_certificate.h" | 28 #include "net/base/x509_certificate.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
| 30 | 31 |
| 31 PageInfoModel::PageInfoModel(Profile* profile, | 32 PageInfoModel::PageInfoModel(Profile* profile, |
| 32 const GURL& url, | 33 const GURL& url, |
| 33 const NavigationEntry::SSLStatus& ssl, | 34 const NavigationEntry::SSLStatus& ssl, |
| 34 bool show_history, | 35 bool show_history, |
| 35 PageInfoModelObserver* observer) | 36 PageInfoModelObserver* observer) |
| 36 : observer_(observer) { | 37 : observer_(observer) { |
| 37 Init(); | 38 Init(); |
| 38 | 39 |
| 39 if (url.SchemeIs(chrome::kChromeUIScheme)) { | 40 if (url.SchemeIs(chrome::kChromeUIScheme)) { |
| 40 sections_.push_back( | 41 sections_.push_back( |
| 41 SectionInfo(ICON_STATE_INTERNAL_PAGE, | 42 SectionInfo(ICON_STATE_INTERNAL_PAGE, |
| 42 ASCIIToUTF16(""), | 43 string16(), |
| 43 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE), | 44 l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE), |
| 44 SECTION_INFO_INTERNAL_PAGE)); | 45 SECTION_INFO_INTERNAL_PAGE)); |
| 45 return; | 46 return; |
| 46 } | 47 } |
| 47 | 48 |
| 48 SectionStateIcon icon_id = ICON_STATE_OK; | 49 SectionStateIcon icon_id = ICON_STATE_OK; |
| 49 string16 headline; | 50 string16 headline; |
| 50 string16 description; | 51 string16 description; |
| 51 scoped_refptr<net::X509Certificate> cert; | 52 scoped_refptr<net::X509Certificate> cert; |
| 52 | 53 |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 // Loads the icons into the vector. The order must match the SectionStateIcon | 348 // Loads the icons into the vector. The order must match the SectionStateIcon |
| 348 // enum. | 349 // enum. |
| 349 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 350 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 350 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_GOOD)); | 351 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_GOOD)); |
| 351 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MINOR)); | 352 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MINOR)); |
| 352 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MAJOR)); | 353 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MAJOR)); |
| 353 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_BAD)); | 354 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_BAD)); |
| 354 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_INFO)); | 355 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_INFO)); |
| 355 icons_.push_back(&rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_26)); | 356 icons_.push_back(&rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_26)); |
| 356 } | 357 } |
| OLD | NEW |