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

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

Issue 10782004: Removing usage of profile_->GetHistory() from the codebase in order to remove that function. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/memory_purger.cc ('k') | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_purger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698