summaryrefslogtreecommitdiffstats
path: root/chrome/browser/page_info_window.cc
diff options
context:
space:
mode:
authormark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 19:21:56 +0000
committermark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-17 19:21:56 +0000
commit3c46b15df4004309cce51688337b43d5af2722c4 (patch)
tree6b5f81d68fa9e2af81a3e78275ee0eeadeb70d50 /chrome/browser/page_info_window.cc
parentb55530cc5f175911fac5803367fcb1194a935da8 (diff)
downloadchromium_src-3c46b15df4004309cce51688337b43d5af2722c4.zip
chromium_src-3c46b15df4004309cce51688337b43d5af2722c4.tar.gz
chromium_src-3c46b15df4004309cce51688337b43d5af2722c4.tar.bz2
Implements the Page Info window on Mac.
- Splits out the code that was in chrome/browser/views/page_info_window.{cc,h} into a platform-independent class PageInfoWindow in chrome/browser/page_info_window.{cc,h} - The Windows implementation now lives in chrome/browser/views/page_info_window_win.{cc,h} - Created a Mac implemenation PageInfoWindowMac in chrome/browser/cocoa/page_info_window_mac.{h,mm} to bridge to a Cocoa NSWindowController - Created a new NSWindowController subclass PageInfoWindowController that is in chrome/browser/cocoa/page_info_window_controller.{h,mm} - Created a XIB for the page info window in chrome/app/nibs/en.lproj/PageInfo.xib Patch by Robert Sesek <rsesek@bluestatic.org> Review URL: http://codereview.chromium.org/115116 Review URL: http://codereview.chromium.org/125266 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18643 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/page_info_window.cc')
-rw-r--r--chrome/browser/page_info_window.cc63
1 files changed, 63 insertions, 0 deletions
diff --git a/chrome/browser/page_info_window.cc b/chrome/browser/page_info_window.cc
new file mode 100644
index 0000000..c18ef06
--- /dev/null
+++ b/chrome/browser/page_info_window.cc
@@ -0,0 +1,63 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/page_info_window.h"
+
+#include "chrome/common/pref_names.h"
+#include "chrome/common/pref_service.h"
+
+PageInfoWindow::PageInfoWindow() : cert_id_(0) {
+}
+
+PageInfoWindow::~PageInfoWindow() {
+}
+
+#if defined(OS_LINUX)
+// TODO(rsesek): Remove once we have a PageInfoWindowLinux implementation
+PageInfoWindow* PageInfoWindow::Factory() {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+#endif
+
+// static
+void PageInfoWindow::CreatePageInfo(Profile* profile,
+ NavigationEntry* nav_entry,
+ gfx::NativeView parent,
+ PageInfoWindow::TabID tab) {
+ PageInfoWindow* window = Factory();
+ window->Init(profile, nav_entry->url(), nav_entry->ssl(),
+ nav_entry->page_type(), true, parent);
+ window->Show();
+}
+
+// static
+void PageInfoWindow::CreateFrameInfo(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ gfx::NativeView parent,
+ TabID tab) {
+ PageInfoWindow* window = Factory();
+ window->Init(profile, url, ssl, NavigationEntry::NORMAL_PAGE,
+ false, parent);
+ window->Show();
+}
+
+// static
+void PageInfoWindow::RegisterPrefs(PrefService* prefs) {
+ prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement);
+}
+
+// static
+std::string PageInfoWindow::GetIssuerName(
+ const net::X509Certificate::Principal& issuer) {
+ if (!issuer.common_name.empty())
+ return issuer.common_name;
+ if (!issuer.organization_names.empty())
+ return issuer.organization_names[0];
+ if (!issuer.organization_unit_names.empty())
+ return issuer.organization_unit_names[0];
+
+ return std::string();
+}