OLD | NEW |
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 "app/resource_bundle.h" | 10 #include "app/resource_bundle.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/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/cert_store.h" | 15 #include "chrome/browser/cert_store.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ssl/ssl_manager.h" | 18 #include "chrome/browser/ssl/ssl_manager.h" |
19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
22 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
23 #include "net/base/cert_status_flags.h" | 23 #include "net/base/cert_status_flags.h" |
24 #include "net/base/ssl_connection_status_flags.h" | 24 #include "net/base/ssl_connection_status_flags.h" |
25 #include "net/base/ssl_cipher_suite_names.h" | 25 #include "net/base/ssl_cipher_suite_names.h" |
26 #include "net/base/x509_certificate.h" | 26 #include "net/base/x509_certificate.h" |
27 | 27 |
28 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
29 #include "base/mac_util.h" | 29 #include "base/mac/mac_util.h" |
30 #endif | 30 #endif |
31 | 31 |
32 PageInfoModel::PageInfoModel(Profile* profile, | 32 PageInfoModel::PageInfoModel(Profile* profile, |
33 const GURL& url, | 33 const GURL& url, |
34 const NavigationEntry::SSLStatus& ssl, | 34 const NavigationEntry::SSLStatus& ssl, |
35 bool show_history, | 35 bool show_history, |
36 PageInfoModelObserver* observer) | 36 PageInfoModelObserver* observer) |
37 : observer_(observer) { | 37 : observer_(observer) { |
38 Init(); | 38 Init(); |
39 | 39 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 &request_consumer_, | 270 &request_consumer_, |
271 NewCallback(this, &PageInfoModel::OnGotVisitCountToHost)); | 271 NewCallback(this, &PageInfoModel::OnGotVisitCountToHost)); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 PageInfoModel::~PageInfoModel() { | 275 PageInfoModel::~PageInfoModel() { |
276 #if defined(OS_MACOSX) | 276 #if defined(OS_MACOSX) |
277 // Release the NSImages. | 277 // Release the NSImages. |
278 for (std::vector<gfx::NativeImage>::iterator it = icons_.begin(); | 278 for (std::vector<gfx::NativeImage>::iterator it = icons_.begin(); |
279 it != icons_.end(); ++it) { | 279 it != icons_.end(); ++it) { |
280 mac_util::NSObjectRelease(*it); | 280 base::mac::NSObjectRelease(*it); |
281 } | 281 } |
282 #endif | 282 #endif |
283 } | 283 } |
284 | 284 |
285 int PageInfoModel::GetSectionCount() { | 285 int PageInfoModel::GetSectionCount() { |
286 return sections_.size(); | 286 return sections_.size(); |
287 } | 287 } |
288 | 288 |
289 PageInfoModel::SectionInfo PageInfoModel::GetSectionInfo(int index) { | 289 PageInfoModel::SectionInfo PageInfoModel::GetSectionInfo(int index) { |
290 DCHECK(index < static_cast<int>(sections_.size())); | 290 DCHECK(index < static_cast<int>(sections_.size())); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 icons_.push_back(GetBitmapNamed(IDR_PAGEINFO_BAD)); | 348 icons_.push_back(GetBitmapNamed(IDR_PAGEINFO_BAD)); |
349 icons_.push_back(GetBitmapNamed(IDR_PAGEINFO_INFO)); | 349 icons_.push_back(GetBitmapNamed(IDR_PAGEINFO_INFO)); |
350 } | 350 } |
351 | 351 |
352 gfx::NativeImage PageInfoModel::GetBitmapNamed(int resource_id) { | 352 gfx::NativeImage PageInfoModel::GetBitmapNamed(int resource_id) { |
353 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 353 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
354 gfx::NativeImage image = rb.GetNativeImageNamed(resource_id); | 354 gfx::NativeImage image = rb.GetNativeImageNamed(resource_id); |
355 #if defined(OS_MACOSX) | 355 #if defined(OS_MACOSX) |
356 // Unlike other platforms, the Mac ResourceBundle does not keep a shared image | 356 // Unlike other platforms, the Mac ResourceBundle does not keep a shared image |
357 // cache. These are released in the dtor. | 357 // cache. These are released in the dtor. |
358 mac_util::NSObjectRetain(image); | 358 base::mac::NSObjectRetain(image); |
359 #endif | 359 #endif |
360 return image; | 360 return image; |
361 } | 361 } |
OLD | NEW |