| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/string16.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/history/history_service_factory.h" |
| 16 #include "chrome/browser/page_info_model_observer.h" | 17 #include "chrome/browser/page_info_model_observer.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ssl/ssl_error_info.h" | 19 #include "chrome/browser/ssl/ssl_error_info.h" |
| 19 #include "content/public/browser/cert_store.h" | 20 #include "content/public/browser/cert_store.h" |
| 20 #include "content/public/common/ssl_status.h" | 21 #include "content/public/common/ssl_status.h" |
| 21 #include "content/public/common/url_constants.h" | 22 #include "content/public/common/url_constants.h" |
| 22 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 24 #include "grit/theme_resources.h" | 25 #include "grit/theme_resources.h" |
| 25 #include "net/base/cert_status_flags.h" | 26 #include "net/base/cert_status_flags.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 272 |
| 272 if (!description.empty()) { | 273 if (!description.empty()) { |
| 273 sections_.push_back(SectionInfo( | 274 sections_.push_back(SectionInfo( |
| 274 icon_id, | 275 icon_id, |
| 275 headline, | 276 headline, |
| 276 description, | 277 description, |
| 277 SECTION_INFO_CONNECTION)); | 278 SECTION_INFO_CONNECTION)); |
| 278 } | 279 } |
| 279 | 280 |
| 280 // Request the number of visits. | 281 // Request the number of visits. |
| 281 HistoryService* history = profile->GetHistoryService( | 282 HistoryService* history = HistoryServiceFactory::GetForProfile( |
| 282 Profile::EXPLICIT_ACCESS); | 283 profile, Profile::EXPLICIT_ACCESS); |
| 283 if (show_history && history) { | 284 if (show_history && history) { |
| 284 history->GetVisibleVisitCountToHost( | 285 history->GetVisibleVisitCountToHost( |
| 285 url, | 286 url, |
| 286 &request_consumer_, | 287 &request_consumer_, |
| 287 base::Bind(&PageInfoModel::OnGotVisitCountToHost, | 288 base::Bind(&PageInfoModel::OnGotVisitCountToHost, |
| 288 base::Unretained(this))); | 289 base::Unretained(this))); |
| 289 } | 290 } |
| 290 | 291 |
| 291 if (ssl.cert_id) { | 292 if (ssl.cert_id) { |
| 292 certificate_label_ = l10n_util::GetStringUTF16( | 293 certificate_label_ = l10n_util::GetStringUTF16( |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // Loads the icons into the vector. The order must match the SectionStateIcon | 362 // Loads the icons into the vector. The order must match the SectionStateIcon |
| 362 // enum. | 363 // enum. |
| 363 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 364 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 364 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_GOOD)); | 365 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_GOOD)); |
| 365 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MINOR)); | 366 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MINOR)); |
| 366 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MAJOR)); | 367 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_WARNING_MAJOR)); |
| 367 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_BAD)); | 368 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_BAD)); |
| 368 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_INFO)); | 369 icons_.push_back(&rb.GetNativeImageNamed(IDR_PAGEINFO_INFO)); |
| 369 icons_.push_back(&rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_26)); | 370 icons_.push_back(&rb.GetNativeImageNamed(IDR_PRODUCT_LOGO_26)); |
| 370 } | 371 } |
| OLD | NEW |