summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/nibs/en.lproj/PageInfo.xib799
-rwxr-xr-xchrome/browser/browser_prefs.cc4
-rw-r--r--chrome/browser/cocoa/page_info_window_controller.h61
-rw-r--r--chrome/browser/cocoa/page_info_window_controller.mm88
-rw-r--r--chrome/browser/cocoa/page_info_window_mac.h51
-rw-r--r--chrome/browser/cocoa/page_info_window_mac.mm254
-rw-r--r--chrome/browser/page_info_window.cc63
-rw-r--r--chrome/browser/page_info_window.h80
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc6
-rw-r--r--chrome/browser/views/location_bar_view.cc6
-rw-r--r--chrome/browser/views/page_info_window_win.cc (renamed from chrome/browser/views/page_info_window.cc)105
-rw-r--r--chrome/browser/views/page_info_window_win.h (renamed from chrome/browser/views/page_info_window.h)60
-rw-r--r--chrome/chrome.gyp22
-rw-r--r--chrome/common/temp_scaffolding_stubs.h19
14 files changed, 1463 insertions, 155 deletions
diff --git a/chrome/app/nibs/en.lproj/PageInfo.xib b/chrome/app/nibs/en.lproj/PageInfo.xib
new file mode 100644
index 0000000..dbf014a
--- /dev/null
+++ b/chrome/app/nibs/en.lproj/PageInfo.xib
@@ -0,0 +1,799 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
+ <data>
+ <int key="IBDocument.SystemTarget">1050</int>
+ <string key="IBDocument.SystemVersion">9J61</string>
+ <string key="IBDocument.InterfaceBuilderVersion">677</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
+ <string key="IBDocument.HIToolboxVersion">353.00</string>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="2"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">PageInfoWindowController</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSWindowTemplate" id="1005">
+ <int key="NSWindowStyleMask">7</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{196, 216}, {460, 290}}</string>
+ <int key="NSWTFlags">536870912</int>
+ <string key="NSWindowTitle">Page Information</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <nil key="NSViewClass"/>
+ <string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ <object class="NSView" key="NSWindowView" id="1006">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSBox" id="431855544">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">12</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSView" id="225157021">
+ <reference key="NSNextResponder" ref="431855544"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSImageView" id="962782496">
+ <reference key="NSNextResponder" ref="225157021"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ </object>
+ </object>
+ <string key="NSFrame">{{18, 14}, {30, 30}}</string>
+ <reference key="NSSuperview" ref="225157021"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSImageCell" key="NSCell" id="810131060">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">33554432</int>
+ <int key="NSAlign">0</int>
+ <int key="NSScale">2</int>
+ <int key="NSStyle">0</int>
+ <bool key="NSAnimates">NO</bool>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ </object>
+ <object class="NSTextField" id="848644722">
+ <reference key="NSNextResponder" ref="225157021"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{53, 14}, {358, 30}}</string>
+ <reference key="NSSuperview" ref="225157021"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="482159508">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">272629760</int>
+ <string key="NSContents">Multiline Label</string>
+ <object class="NSFont" key="NSSupport" id="157990634">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.100000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="848644722"/>
+ <object class="NSColor" key="NSBackgroundColor" id="755488189">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="930195236">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 1}, {426, 54}}</string>
+ <reference key="NSSuperview" ref="431855544"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{16, 200}, {428, 70}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <string key="NSOffsets">{0, 0}</string>
+ <object class="NSTextFieldCell" key="NSTitleCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Identity</string>
+ <object class="NSFont" key="NSSupport" id="26">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.100000e+01</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <object class="NSColor" key="NSBackgroundColor" id="359763623">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
+ </object>
+ </object>
+ <reference key="NSContentView" ref="225157021"/>
+ <int key="NSBorderType">1</int>
+ <int key="NSBoxType">0</int>
+ <int key="NSTitlePosition">2</int>
+ <bool key="NSTransparent">NO</bool>
+ </object>
+ <object class="NSBox" id="792616117">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">12</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSView" id="277547661">
+ <reference key="NSNextResponder" ref="792616117"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSImageView" id="988006815">
+ <reference key="NSNextResponder" ref="277547661"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ </object>
+ </object>
+ <string key="NSFrame">{{18, 14}, {30, 30}}</string>
+ <reference key="NSSuperview" ref="277547661"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSImageCell" key="NSCell" id="612578912">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">33554432</int>
+ <int key="NSAlign">0</int>
+ <int key="NSScale">2</int>
+ <int key="NSStyle">0</int>
+ <bool key="NSAnimates">NO</bool>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ </object>
+ <object class="NSTextField" id="527959022">
+ <reference key="NSNextResponder" ref="277547661"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{53, 14}, {358, 30}}</string>
+ <reference key="NSSuperview" ref="277547661"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="937890898">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">272629760</int>
+ <string key="NSContents">Multiline Label</string>
+ <reference key="NSSupport" ref="157990634"/>
+ <reference key="NSControlView" ref="527959022"/>
+ <reference key="NSBackgroundColor" ref="755488189"/>
+ <reference key="NSTextColor" ref="930195236"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 1}, {426, 54}}</string>
+ <reference key="NSSuperview" ref="792616117"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{16, 126}, {428, 70}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <string key="NSOffsets">{0, 0}</string>
+ <object class="NSTextFieldCell" key="NSTitleCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Connection</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSBackgroundColor" ref="359763623"/>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
+ </object>
+ </object>
+ <reference key="NSContentView" ref="277547661"/>
+ <int key="NSBorderType">1</int>
+ <int key="NSBoxType">0</int>
+ <int key="NSTitlePosition">2</int>
+ <bool key="NSTransparent">NO</bool>
+ </object>
+ <object class="NSBox" id="901112678">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">12</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSView" id="1038706718">
+ <reference key="NSNextResponder" ref="901112678"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSImageView" id="763385001">
+ <reference key="NSNextResponder" ref="1038706718"/>
+ <int key="NSvFlags">268</int>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ </object>
+ </object>
+ <string key="NSFrame">{{18, 14}, {30, 30}}</string>
+ <reference key="NSSuperview" ref="1038706718"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSImageCell" key="NSCell" id="505989441">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">33554432</int>
+ <int key="NSAlign">0</int>
+ <int key="NSScale">2</int>
+ <int key="NSStyle">0</int>
+ <bool key="NSAnimates">NO</bool>
+ </object>
+ <bool key="NSEditable">YES</bool>
+ </object>
+ <object class="NSTextField" id="733407920">
+ <reference key="NSNextResponder" ref="1038706718"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{53, 14}, {358, 30}}</string>
+ <reference key="NSSuperview" ref="1038706718"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="768941348">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">272629760</int>
+ <string key="NSContents">Multiline Label</string>
+ <reference key="NSSupport" ref="157990634"/>
+ <reference key="NSControlView" ref="733407920"/>
+ <reference key="NSBackgroundColor" ref="755488189"/>
+ <reference key="NSTextColor" ref="930195236"/>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 1}, {426, 54}}</string>
+ <reference key="NSSuperview" ref="901112678"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{16, 52}, {428, 70}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <string key="NSOffsets">{0, 0}</string>
+ <object class="NSTextFieldCell" key="NSTitleCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Visit History</string>
+ <reference key="NSSupport" ref="26"/>
+ <reference key="NSBackgroundColor" ref="359763623"/>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
+ </object>
+ </object>
+ <reference key="NSContentView" ref="1038706718"/>
+ <int key="NSBorderType">1</int>
+ <int key="NSBoxType">0</int>
+ <int key="NSTitlePosition">2</int>
+ <bool key="NSTransparent">NO</bool>
+ </object>
+ <object class="NSButton" id="339407270">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{13, 12}, {227, 32}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="395621113">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">View certificate information...</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.300000e+01</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="339407270"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{460, 290}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+ <string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">5</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showCertWindow:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="339407270"/>
+ </object>
+ <int key="connectionID">39</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">enabled: enableCertButton_</string>
+ <reference key="source" ref="339407270"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="339407270"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">enabled: enableCertButton_</string>
+ <string key="NSBinding">enabled</string>
+ <string key="NSKeyPath">enableCertButton_</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">47</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: historyImg</string>
+ <reference key="source" ref="763385001"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="763385001"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">value: historyImg</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">historyImg</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">48</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: historyMsg</string>
+ <reference key="source" ref="733407920"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="733407920"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">value: historyMsg</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">historyMsg</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">51</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: connectionMsg</string>
+ <reference key="source" ref="527959022"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="527959022"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">value: connectionMsg</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">connectionMsg</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">52</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: connectionImg</string>
+ <reference key="source" ref="988006815"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="988006815"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">value: connectionImg</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">connectionImg</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">53</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: identityMsg</string>
+ <reference key="source" ref="848644722"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="848644722"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">value: identityMsg</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">identityMsg</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">54</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBBindingConnection" key="connection">
+ <string key="label">value: identityImg</string>
+ <reference key="source" ref="962782496"/>
+ <reference key="destination" ref="1001"/>
+ <object class="NSNibBindingConnector" key="connector">
+ <reference key="NSSource" ref="962782496"/>
+ <reference key="NSDestination" ref="1001"/>
+ <string key="NSLabel">value: identityImg</string>
+ <string key="NSBinding">value</string>
+ <string key="NSKeyPath">identityImg</string>
+ <int key="NSNibBindingConnectorVersion">2</int>
+ </object>
+ </object>
+ <int key="connectionID">55</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">56</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">historyBox_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="901112678"/>
+ </object>
+ <int key="connectionID">57</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <object class="NSArray" key="object" id="1002">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1001"/>
+ <reference key="parent" ref="1002"/>
+ <string type="base64-UTF8" key="objectName">RmlsZSdzIE93bmVyA</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1003"/>
+ <reference key="parent" ref="1002"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="1002"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1006"/>
+ </object>
+ <reference key="parent" ref="1002"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="1006"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="431855544"/>
+ <reference ref="792616117"/>
+ <reference ref="901112678"/>
+ <reference ref="339407270"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">6</int>
+ <reference key="object" ref="431855544"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="962782496"/>
+ <reference ref="848644722"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">7</int>
+ <reference key="object" ref="792616117"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="988006815"/>
+ <reference ref="527959022"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="901112678"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="763385001"/>
+ <reference ref="733407920"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="339407270"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="395621113"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">12</int>
+ <reference key="object" ref="395621113"/>
+ <reference key="parent" ref="339407270"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">20</int>
+ <reference key="object" ref="763385001"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="505989441"/>
+ </object>
+ <reference key="parent" ref="901112678"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="505989441"/>
+ <reference key="parent" ref="763385001"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">17</int>
+ <reference key="object" ref="962782496"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="810131060"/>
+ </object>
+ <reference key="parent" ref="431855544"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">18</int>
+ <reference key="object" ref="810131060"/>
+ <reference key="parent" ref="962782496"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">22</int>
+ <reference key="object" ref="988006815"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="612578912"/>
+ </object>
+ <reference key="parent" ref="792616117"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="612578912"/>
+ <reference key="parent" ref="988006815"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">28</int>
+ <reference key="object" ref="848644722"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="482159508"/>
+ </object>
+ <reference key="parent" ref="431855544"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">29</int>
+ <reference key="object" ref="482159508"/>
+ <reference key="parent" ref="848644722"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">30</int>
+ <reference key="object" ref="527959022"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="937890898"/>
+ </object>
+ <reference key="parent" ref="792616117"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">31</int>
+ <reference key="object" ref="937890898"/>
+ <reference key="parent" ref="527959022"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">32</int>
+ <reference key="object" ref="733407920"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="768941348"/>
+ </object>
+ <reference key="parent" ref="901112678"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">33</int>
+ <reference key="object" ref="768941348"/>
+ <reference key="parent" ref="733407920"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-1.IBPluginDependency</string>
+ <string>-2.IBPluginDependency</string>
+ <string>-3.IBPluginDependency</string>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.IBViewEditorWindowController.showingBoundsRectangles</string>
+ <string>1.IBWindowTemplateEditedContentRect</string>
+ <string>1.NSWindowTemplate.visibleAtLaunch</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>11.IBPluginDependency</string>
+ <string>12.IBPluginDependency</string>
+ <string>17.IBPluginDependency</string>
+ <string>18.IBPluginDependency</string>
+ <string>2.IBPluginDependency</string>
+ <string>20.IBPluginDependency</string>
+ <string>21.IBPluginDependency</string>
+ <string>22.IBPluginDependency</string>
+ <string>23.IBPluginDependency</string>
+ <string>28.IBPluginDependency</string>
+ <string>29.IBPluginDependency</string>
+ <string>30.IBPluginDependency</string>
+ <string>31.IBPluginDependency</string>
+ <string>32.IBPluginDependency</string>
+ <string>33.IBPluginDependency</string>
+ <string>6.IBPluginDependency</string>
+ <string>7.IBPluginDependency</string>
+ <string>8.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{549, 366}, {460, 290}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <boolean value="NO"/>
+ <string>{{549, 366}, {460, 290}}</string>
+ <integer value="1"/>
+ <string>{196, 240}</string>
+ <string>{{357, 418}, {480, 270}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">57</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/tab_strip_model_observer_bridge.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">PageInfoWindowController</string>
+ <string key="superclassName">NSWindowController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">showCertWindow:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">historyBox_</string>
+ <string key="NS.object.0">NSBox</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">browser/cocoa/page_info_window_controller.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../../../chrome.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
diff --git a/chrome/browser/browser_prefs.cc b/chrome/browser/browser_prefs.cc
index 24ff76f..f8c5f7f 100755
--- a/chrome/browser/browser_prefs.cc
+++ b/chrome/browser/browser_prefs.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/net/dns_global.h"
+#include "chrome/browser/page_info_window.h"
#include "chrome/browser/password_manager/password_manager.h"
#include "chrome/browser/renderer_host/browser_render_process_host.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
@@ -28,7 +29,6 @@
#include "chrome/browser/task_manager.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/keyword_editor_view.h"
-#include "chrome/browser/views/page_info_window.h"
#endif
namespace browser {
@@ -45,9 +45,9 @@ void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) {
browser_shutdown::RegisterPrefs(local_state);
chrome_browser_net::RegisterPrefs(local_state);
bookmark_utils::RegisterPrefs(local_state);
+ PageInfoWindow::RegisterPrefs(local_state);
#if defined(OS_WIN) // TODO(port): whittle this down as we port
BrowserView::RegisterBrowserViewPrefs(local_state);
- PageInfoWindow::RegisterPrefs(local_state);
TaskManager::RegisterPrefs(local_state);
#endif
diff --git a/chrome/browser/cocoa/page_info_window_controller.h b/chrome/browser/cocoa/page_info_window_controller.h
new file mode 100644
index 0000000..7c8fce5
--- /dev/null
+++ b/chrome/browser/cocoa/page_info_window_controller.h
@@ -0,0 +1,61 @@
+// Copyright (c) 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.
+
+#import <Cocoa/Cocoa.h>
+
+#include "base/scoped_nsobject.h"
+#include "base/scoped_ptr.h"
+
+class PageInfoWindow;
+class PageInfoWindowMac;
+
+// This NSWindowController subclass implements the Cocoa window for
+// PageInfoWindow. This creates and owns the PageInfoWindowMac subclass.
+
+@interface PageInfoWindowController : NSWindowController {
+ @private
+ // We load both images and then we share the refs with our UI elements.
+ scoped_nsobject<NSImage> goodImg_;
+ scoped_nsobject<NSImage> badImg_;
+
+ // User interface item values. The NIB uses KVO to get these, so the values
+ // are not explicitly set in the view by the controller.
+ NSImage* identityImg_;
+ NSImage* connectionImg_;
+ NSImage* historyImg_;
+ NSString* identityMsg_;
+ NSString* connectionMsg_;
+ NSString* historyMsg_;
+ BOOL enableCertButton_;
+
+ // Box that allows us to show/hide the history information.
+ IBOutlet NSBox* historyBox_;
+
+ // Bridge to Chromium that we own.
+ scoped_ptr<PageInfoWindowMac> pageInfo_;
+}
+
+@property(readwrite, retain) NSImage* identityImg;
+@property(readwrite, retain) NSImage* connectionImg;
+@property(readwrite, retain) NSImage* historyImg;
+@property(readwrite, copy) NSString* identityMsg;
+@property(readwrite, copy) NSString* connectionMsg;
+@property(readwrite, copy) NSString* historyMsg;
+@property(readwrite) BOOL enableCertButton;
+
+// Returns the bridge between Cocoa and Chromium.
+- (PageInfoWindow*)pageInfo;
+
+// Returns the good and bad image refs.
+- (NSImage*)goodImg;
+- (NSImage*)badImg;
+
+// Shows the certificate display window
+- (IBAction)showCertWindow:(id)sender;
+
+// Sets whether or not to show or hide the history box. This will resize the
+// frame of the window.
+- (void)setShowHistoryBox:(BOOL)show;
+
+@end
diff --git a/chrome/browser/cocoa/page_info_window_controller.mm b/chrome/browser/cocoa/page_info_window_controller.mm
new file mode 100644
index 0000000..0e895e1
--- /dev/null
+++ b/chrome/browser/cocoa/page_info_window_controller.mm
@@ -0,0 +1,88 @@
+// Copyright (c) 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.
+
+#import "chrome/browser/cocoa/page_info_window_controller.h"
+
+#include "base/mac_util.h"
+#include "chrome/browser/cocoa/page_info_window_mac.h"
+
+@implementation PageInfoWindowController
+@synthesize identityImg = identityImg_;
+@synthesize connectionImg = connectionImg_;
+@synthesize historyImg = historyImg_;
+@synthesize identityMsg = identityMsg_;
+@synthesize connectionMsg = connectionMsg_;
+@synthesize historyMsg = historyMsg_;
+@synthesize enableCertButton = enableCertButton_;
+
+- (id)init {
+ NSBundle* bundle = mac_util::MainAppBundle();
+ NSString* nibpath = [bundle pathForResource:@"PageInfo" ofType:@"nib"];
+ if ((self = [super initWithWindowNibPath:nibpath owner:self])) {
+ pageInfo_.reset(new PageInfoWindowMac(self));
+
+ // Load the image refs.
+ NSImage* img = [[NSImage alloc] initByReferencingFile:
+ [bundle pathForResource:@"pageinfo_good" ofType:@"png"]];
+ goodImg_.reset(img);
+
+ img = [[NSImage alloc] initByReferencingFile:
+ [bundle pathForResource:@"pageinfo_bad" ofType:@"png"]];
+ badImg_.reset(img);
+ }
+ return self;
+}
+
+- (void)awakeFromNib {
+ // By default, assume we have no history information.
+ [self setShowHistoryBox:NO];
+}
+
+- (void)dealloc {
+ [identityImg_ release];
+ [connectionImg_ release];
+ [historyImg_ release];
+ [identityMsg_ release];
+ [connectionMsg_ release];
+ [historyMsg_ release];
+ [super dealloc];
+}
+
+- (PageInfoWindow*)pageInfo {
+ return pageInfo_.get();
+}
+
+- (NSImage*)goodImg {
+ return goodImg_.get();
+}
+
+- (NSImage*)badImg {
+ return badImg_.get();
+}
+
+- (IBAction)showCertWindow:(id)sender {
+ pageInfo_->ShowCertDialog(0); // Pass it any int because it's ignored.
+}
+
+- (void)setShowHistoryBox:(BOOL)show {
+ [historyBox_ setHidden:!show];
+
+ NSWindow* window = [self window];
+ NSRect frame = [window frame];
+
+ const NSSize kPageInfoWindowSize = NSMakeSize(460, 235);
+ const NSSize kPageInfoWindowWithHistorySize = NSMakeSize(460, 310);
+
+ frame.size = (show ? kPageInfoWindowWithHistorySize : kPageInfoWindowSize);
+
+ [window setFrame:frame display:YES animate:YES];
+}
+
+// If the page info window gets closed, we have nothing left to manage and we
+// can clean ourselves up.
+- (void)windowWillClose:(NSNotification*)notif {
+ [self autorelease];
+}
+
+@end
diff --git a/chrome/browser/cocoa/page_info_window_mac.h b/chrome/browser/cocoa/page_info_window_mac.h
new file mode 100644
index 0000000..1665b79
--- /dev/null
+++ b/chrome/browser/cocoa/page_info_window_mac.h
@@ -0,0 +1,51 @@
+// Copyright (c) 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.
+
+#ifndef CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_
+#define CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_
+
+#include "chrome/browser/history/history.h"
+#include "chrome/browser/page_info_window.h"
+
+class CancelableRequestConsumerBase;
+class Profile;
+@class PageInfoWindowController;
+
+namespace base {
+class Time;
+}
+
+class PageInfoWindowMac : public PageInfoWindow {
+ public:
+ PageInfoWindowMac(PageInfoWindowController* controller);
+ virtual ~PageInfoWindowMac();
+
+ // This is the main initializer that creates the window.
+ virtual void Init(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ NavigationEntry::PageType page_type,
+ bool show_history,
+ gfx::NativeView parent);
+
+ virtual void Show();
+
+ // Shows various information for the specified certificate in a new dialog.
+ // The argument is ignored here and we use the |cert_id_| member that was
+ // passed to us in Init().
+ virtual void ShowCertDialog(int);
+
+ private:
+ void OnGotVisitCountToHost(HistoryService::Handle handle,
+ bool found_visits,
+ int count,
+ base::Time first_visit);
+
+ CancelableRequestConsumer request_consumer_; // Used for getting visit count.
+ PageInfoWindowController* controller_; // WEAK, owns us.
+
+ DISALLOW_COPY_AND_ASSIGN(PageInfoWindowMac);
+};
+
+#endif // CHROME_BROWSER_COCOA_PAGE_INFO_WINDOW_MAC_H_
diff --git a/chrome/browser/cocoa/page_info_window_mac.mm b/chrome/browser/cocoa/page_info_window_mac.mm
new file mode 100644
index 0000000..b76d74d
--- /dev/null
+++ b/chrome/browser/cocoa/page_info_window_mac.mm
@@ -0,0 +1,254 @@
+// Copyright (c) 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/cocoa/page_info_window_mac.h"
+
+#include <Security/Security.h>
+#include <SecurityInterface/SFCertificatePanel.h>
+
+#include "app/l10n_util.h"
+#include "base/string_util.h"
+#include "base/time_format.h"
+#include "base/sys_string_conversions.h"
+#import "chrome/browser/cocoa/page_info_window_controller.h"
+#include "chrome/browser/cert_store.h"
+#include "chrome/browser/profile.h"
+#include "grit/generated_resources.h"
+#include "net/base/cert_status_flags.h"
+#include "net/base/x509_certificate.h"
+
+using base::Time;
+
+PageInfoWindow* PageInfoWindow::Factory() {
+ // The controller will clean itself up after the NSWindow it manages closes.
+ // We do not manage it as it owns us.
+ PageInfoWindowController* controller =
+ [[PageInfoWindowController alloc] init];
+ return [controller pageInfo];
+}
+
+PageInfoWindowMac::PageInfoWindowMac(PageInfoWindowController* controller)
+ : PageInfoWindow(), controller_(controller) {
+}
+
+PageInfoWindowMac::~PageInfoWindowMac() {
+}
+
+void PageInfoWindowMac::Show() {
+ [[controller_ window] makeKeyAndOrderFront:nil];
+}
+
+void PageInfoWindowMac::ShowCertDialog(int) {
+ DCHECK(cert_id_ != 0);
+ scoped_refptr<net::X509Certificate> cert;
+ CertStore::GetSharedInstance()->RetrieveCert(cert_id_, &cert);
+ if (!cert.get()) {
+ // The certificate was not found. Could be that the renderer crashed before
+ // we displayed the page info.
+ return;
+ }
+
+ SecCertificateRef cert_mac = cert->os_cert_handle();
+ if (!cert_mac)
+ return;
+
+ [[SFCertificatePanel sharedCertificatePanel]
+ beginSheetForWindow:[controller_ window]
+ modalDelegate:nil
+ didEndSelector:NULL
+ contextInfo:NULL
+ // This is cast to id because we get compiler errors about an
+ // OpaqueSecCertificateRef* being converted to an ObjC class.
+ // It's a CF-type so it's toll-free bridged and casting to id
+ // is OK.
+ certificates:[NSArray arrayWithObject:(id)cert_mac]
+ showGroup:YES
+ ];
+}
+
+void PageInfoWindowMac::Init(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ NavigationEntry::PageType page_type,
+ bool show_history,
+ gfx::NativeView parent) {
+ // These wstring's will be converted to NSString's and passed to the
+ // window controller when we're done figuring out what text should go in them.
+ std::wstring identity_msg;
+ std::wstring connection_msg;
+
+ // Set all the images to "good" mode.
+ [controller_ setIdentityImg:[controller_ goodImg]];
+ [controller_ setConnectionImg:[controller_ goodImg]];
+
+ cert_id_ = ssl.cert_id();
+ scoped_refptr<net::X509Certificate> cert;
+
+ // Identity section
+ std::wstring identity_title;
+ std::wstring subject_name(UTF8ToWide(url.host()));
+ bool empty_subject_name = subject_name.empty();
+ if (empty_subject_name) {
+ subject_name.assign(
+ l10n_util::GetString(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY));
+ }
+ if (page_type == NavigationEntry::NORMAL_PAGE && cert_id_ &&
+ CertStore::GetSharedInstance()->RetrieveCert(cert_id_, &cert) &&
+ !net::IsCertStatusError(ssl.cert_status())) {
+ // OK HTTPS page
+ if ((ssl.cert_status() & net::CERT_STATUS_IS_EV) != 0) {
+ DCHECK(!cert->subject().organization_names.empty());
+ identity_title =
+ l10n_util::GetStringF(IDS_PAGE_INFO_EV_IDENTITY_TITLE,
+ UTF8ToWide(cert->subject().organization_names[0]),
+ UTF8ToWide(url.host()));
+ // An EV cert is required to have a city (localityName) and country but
+ // state is "if any".
+ DCHECK(!cert->subject().locality_name.empty());
+ DCHECK(!cert->subject().country_name.empty());
+ std::wstring locality;
+ if (!cert->subject().state_or_province_name.empty()) {
+ locality = l10n_util::GetStringF(
+ IDS_PAGEINFO_ADDRESS,
+ UTF8ToWide(cert->subject().locality_name),
+ UTF8ToWide(cert->subject().state_or_province_name),
+ UTF8ToWide(cert->subject().country_name));
+ } else {
+ locality = l10n_util::GetStringF(
+ IDS_PAGEINFO_PARTIAL_ADDRESS,
+ UTF8ToWide(cert->subject().locality_name),
+ UTF8ToWide(cert->subject().country_name));
+ }
+ DCHECK(!cert->subject().organization_names.empty());
+ identity_msg.assign(l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV,
+ UTF8ToWide(cert->subject().organization_names[0]),
+ locality,
+ UTF8ToWide(PageInfoWindow::GetIssuerName(cert->issuer()))));
+ } else {
+ // Non EV OK HTTPS.
+ if (empty_subject_name)
+ identity_title.clear(); // Don't display any title.
+ else
+ identity_title.assign(subject_name);
+ std::wstring issuer_name(UTF8ToWide(
+ PageInfoWindow::GetIssuerName(cert->issuer())));
+ if (issuer_name.empty()) {
+ issuer_name.assign(
+ l10n_util::GetString(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY));
+ } else {
+ identity_msg.assign(
+ l10n_util::GetStringF(IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY,
+ issuer_name));
+ }
+ }
+ } else {
+ // Bad HTTPS.
+ identity_msg.assign(
+ l10n_util::GetString(IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY));
+ [controller_ setIdentityImg:[controller_ badImg]];
+ }
+
+ // Connection section.
+ // We consider anything less than 80 bits encryption to be weak encryption.
+ // TODO(wtc): Bug 1198735: report mixed/unsafe content for unencrypted and
+ // weakly encrypted connections.
+ if (ssl.security_bits() <= 0) {
+ [controller_ setConnectionImg:[controller_ badImg]];
+ connection_msg.assign(
+ l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_NOT_ENCRYPTED_CONNECTION_TEXT,
+ subject_name));
+ } else if (ssl.security_bits() < 80) {
+ [controller_ setConnectionImg:[controller_ badImg]];
+ connection_msg.assign(
+ l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_WEAK_ENCRYPTION_CONNECTION_TEXT,
+ subject_name));
+ } else {
+ connection_msg.assign(
+ l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_CONNECTION_TEXT,
+ subject_name,
+ IntToWString(ssl.security_bits())));
+ if (ssl.has_mixed_content()) {
+ [controller_ setConnectionImg:[controller_ badImg]];
+ connection_msg.assign(
+ l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK,
+ connection_msg,
+ l10n_util::GetString(
+ IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_MIXED_CONTENT_WARNING)));
+ } else if (ssl.has_unsafe_content()) {
+ [controller_ setConnectionImg:[controller_ badImg]];
+ connection_msg.assign(
+ l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK,
+ connection_msg,
+ l10n_util::GetString(
+ IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_BAD_HTTPS_WARNING)));
+ }
+ }
+
+ // We've figured out the messages that we want to appear in the page info
+ // window and we now hand them up to the NSWindowController, which binds them
+ // to the Cocoa view.
+ [controller_ setIdentityMsg:base::SysWideToNSString(identity_msg)];
+ [controller_ setConnectionMsg:base::SysWideToNSString(connection_msg)];
+
+ // Request the number of visits.
+ HistoryService* history = profile->GetHistoryService(
+ Profile::EXPLICIT_ACCESS);
+ if (show_history && history) {
+ history->GetVisitCountToHost(
+ url,
+ &request_consumer_,
+ NewCallback(this, &PageInfoWindowMac::OnGotVisitCountToHost));
+ }
+
+ // By default, assume that we don't have certificate information to show.
+ [controller_ setEnableCertButton:NO];
+ if (cert_id_) {
+ // Don't bother showing certificates if there isn't one. Gears runs with no
+ // os root certificate.
+ if (cert.get() && cert->os_cert_handle()) {
+ [controller_ setEnableCertButton:YES];
+ }
+ }
+}
+
+void PageInfoWindowMac::OnGotVisitCountToHost(HistoryService::Handle handle,
+ bool found_visits,
+ int count,
+ Time first_visit) {
+ if (!found_visits) {
+ // This indicates an error, such as the page wasn't http/https; do nothing.
+ return;
+ }
+
+ // We have history information, so show the box and extend the window frame.
+ [controller_ setShowHistoryBox:YES];
+
+ bool visited_before_today = false;
+ if (count) {
+ Time today = Time::Now().LocalMidnight();
+ Time first_visit_midnight = first_visit.LocalMidnight();
+ visited_before_today = (first_visit_midnight < today);
+ }
+
+ if (!visited_before_today) {
+ [controller_ setHistoryImg:[controller_ badImg]];
+ [controller_ setHistoryMsg:
+ base::SysWideToNSString(
+ l10n_util::GetString(
+ IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY))];
+ } else {
+ [controller_ setHistoryImg:[controller_ goodImg]];
+ [controller_ setHistoryMsg:
+ base::SysWideToNSString(
+ l10n_util::GetStringF(
+ IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY,
+ base::TimeFormatShortDate(first_visit)))];
+ }
+}
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();
+}
diff --git a/chrome/browser/page_info_window.h b/chrome/browser/page_info_window.h
new file mode 100644
index 0000000..c39bd38
--- /dev/null
+++ b/chrome/browser/page_info_window.h
@@ -0,0 +1,80 @@
+// 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.
+
+#ifndef CHROME_BROWSER_PAGE_INFO_WINDOW_H__
+#define CHROME_BROWSER_PAGE_INFO_WINDOW_H__
+
+#include "base/gfx/native_widget_types.h"
+#include "chrome/browser/tab_contents/navigation_entry.h"
+#include "googleurl/src/gurl.h"
+#include "net/base/x509_certificate.h"
+
+// The page info window displays information regarding the current page,
+// including security information.
+
+class NavigationEntry;
+class PageInfoContentView;
+class PrefService;
+class Profile;
+
+class PageInfoWindow {
+ public:
+ enum TabID {
+ GENERAL = 0,
+ SECURITY,
+ };
+
+ // Factory method to get a new platform impl of PageInfoWindow
+ static PageInfoWindow* Factory();
+
+ // Creates and shows a new page info window for the main page.
+ static void CreatePageInfo(Profile* profile,
+ NavigationEntry* nav_entry,
+ gfx::NativeView parent,
+ TabID tab);
+
+ // Creates and shows a new page info window for the frame at |url| with the
+ // specified SSL information.
+ static void CreateFrameInfo(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ gfx::NativeView parent,
+ TabID tab);
+
+ static void RegisterPrefs(PrefService* prefs);
+
+ PageInfoWindow();
+ virtual ~PageInfoWindow();
+
+ // This is the main initializer that creates the window.
+ virtual void Init(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ NavigationEntry::PageType page_type,
+ bool show_history,
+ gfx::NativeView parent) = 0;
+
+ // Brings the page info window to the foreground.
+ virtual void Show() = 0;
+
+ // Shows various information for the specified certificate in a new dialog.
+ // This can be implemented as an individual window (like on Windows), or as
+ // a modal dialog/sheet (on Mac). Either will work since we're only expecting
+ // one certificate per page.
+ virtual void ShowCertDialog(int cert_id) = 0;
+
+ protected:
+ // Returns a name that can be used to represent the issuer. It tries in this
+ // order CN, O and OU and returns the first non-empty one found.
+ static std::string GetIssuerName(
+ const net::X509Certificate::Principal& issuer);
+
+ // The id of the server cert for this page (0 means no cert).
+ int cert_id_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PageInfoWindow);
+};
+
+#endif // #define CHROME_BROWSER_PAGE_INFO_WINDOW_H__
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 581598d..4926481 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -12,6 +12,7 @@
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_manager.h"
+#include "chrome/browser/page_info_window.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/spellchecker.h"
@@ -27,7 +28,6 @@
#if defined(OS_WIN)
#include "chrome/browser/views/options/fonts_languages_window_view.h"
-#include "chrome/browser/views/page_info_window.h"
#endif
RenderViewContextMenu::RenderViewContextMenu(
@@ -429,7 +429,7 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
break;
case IDS_CONTENT_CONTEXT_VIEWPAGEINFO: {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_MACOSX)
NavigationEntry* nav_entry =
source_tab_contents_->controller().GetActiveEntry();
PageInfoWindow::CreatePageInfo(
@@ -484,7 +484,7 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
ssl.set_cert_status(cert_status);
ssl.set_security_bits(security_bits);
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_MACOSX)
PageInfoWindow::CreateFrameInfo(
profile_,
params_.frame_url,
diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc
index 3f00588..59fbe37 100644
--- a/chrome/browser/views/location_bar_view.cc
+++ b/chrome/browser/views/location_bar_view.cc
@@ -26,6 +26,7 @@
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_tabs_module.h"
#include "chrome/browser/extensions/extensions_service.h"
+#include "chrome/browser/page_info_window.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
@@ -45,7 +46,6 @@
#if defined(OS_WIN)
#include "app/win_util.h"
#include "chrome/browser/views/first_run_bubble.h"
-#include "chrome/browser/views/page_info_window.h"
#else
#include "base/gfx/gtk_util.h"
#include "chrome/browser/gtk/location_bar_view_gtk.h"
@@ -1115,14 +1115,10 @@ bool LocationBarView::SecurityImageView::OnMousePressed(
NOTREACHED();
return true;
}
-#if defined(OS_WIN)
PageInfoWindow::CreatePageInfo(profile_,
nav_entry,
GetRootView()->GetWidget()->GetNativeView(),
PageInfoWindow::SECURITY);
-#else
- NOTIMPLEMENTED();
-#endif
return true;
}
diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window_win.cc
index d05aabb..1d75602 100644
--- a/chrome/browser/views/page_info_window.cc
+++ b/chrome/browser/views/page_info_window_win.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// 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/views/page_info_window.h"
+#include "chrome/browser/views/page_info_window_win.h"
#if defined(OS_WIN)
#include <cryptuiapi.h>
@@ -29,6 +29,7 @@
#include "views/background.h"
#include "views/grid_layout.h"
#include "views/controls/button/native_button.h"
+#include "views/controls/button/button.h"
#include "views/controls/image_view.h"
#include "views/controls/label.h"
#include "views/controls/separator.h"
@@ -101,11 +102,6 @@ class SecurityTabView : public views::View {
DISALLOW_EVIL_CONSTRUCTORS(Section);
};
- // Returns a name that can be used to represent the issuer. It tries in this
- // order CN, O and OU and returns the first non-empty one found.
- static std::string GetIssuerName(
- const net::X509Certificate::Principal& issuer);
-
// Callback from history service with number of visits to url.
void OnGotVisitCountToHost(HistoryService::Handle handle,
bool found_visits,
@@ -282,14 +278,15 @@ SecurityTabView::SecurityTabView(Profile* profile,
IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_EV,
UTF8ToWide(cert->subject().organization_names[0]),
locality,
- UTF8ToWide(GetIssuerName(cert->issuer()))));
+ UTF8ToWide(PageInfoWindow::GetIssuerName(cert->issuer()))));
} else {
// Non EV OK HTTPS.
if (empty_subject_name)
identity_title.clear(); // Don't display any title.
else
identity_title.assign(subject_name);
- std::wstring issuer_name(UTF8ToWide(GetIssuerName(cert->issuer())));
+ std::wstring issuer_name(UTF8ToWide(
+ PageInfoWindow::GetIssuerName(cert->issuer())));
if (issuer_name.empty()) {
issuer_name.assign(
l10n_util::GetString(IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY));
@@ -390,19 +387,6 @@ void SecurityTabView::Layout() {
}
}
-// static
-std::string SecurityTabView::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();
-}
-
void SecurityTabView::OnGotVisitCountToHost(HistoryService::Handle handle,
bool found_visits,
int count,
@@ -472,52 +456,29 @@ class PageInfoContentView : public views::View {
};
////////////////////////////////////////////////////////////////////////////////
-// PageInfoWindow
-
-int PageInfoWindow::opened_window_count_ = 0;
-
-// static
-void PageInfoWindow::CreatePageInfo(Profile* profile,
- NavigationEntry* nav_entry,
- HWND parent_hwnd,
- PageInfoWindow::TabID tab) {
- PageInfoWindow* window = new PageInfoWindow();
- window->Init(profile, nav_entry->url(), nav_entry->ssl(),
- nav_entry->page_type(), true, parent_hwnd);
- window->Show();
-}
+// PageInfoWindowWin
-// static
-void PageInfoWindow::CreateFrameInfo(Profile* profile,
- const GURL& url,
- const NavigationEntry::SSLStatus& ssl,
- HWND parent_hwnd,
- TabID tab) {
- PageInfoWindow* window = new PageInfoWindow();
- window->Init(profile, url, ssl, NavigationEntry::NORMAL_PAGE,
- false, parent_hwnd);
- window->Show();
-}
+int PageInfoWindowWin::opened_window_count_ = 0;
-// static
-void PageInfoWindow::RegisterPrefs(PrefService* prefs) {
- prefs->RegisterDictionaryPref(prefs::kPageInfoWindowPlacement);
+PageInfoWindow* PageInfoWindow::Factory() {
+ return new PageInfoWindowWin();
}
-PageInfoWindow::PageInfoWindow() : cert_id_(0), contents_(NULL) {
+PageInfoWindowWin::PageInfoWindowWin()
+ : PageInfoWindow() {
}
-PageInfoWindow::~PageInfoWindow() {
+PageInfoWindowWin::~PageInfoWindowWin() {
DCHECK(opened_window_count_ > 0);
opened_window_count_--;
}
-void PageInfoWindow::Init(Profile* profile,
- const GURL& url,
- const NavigationEntry::SSLStatus& ssl,
- NavigationEntry::PageType page_type,
- bool show_history,
- HWND parent) {
+void PageInfoWindowWin::Init(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ NavigationEntry::PageType page_type,
+ bool show_history,
+ gfx::NativeView parent) {
cert_id_ = ssl.cert_id();
cert_info_button_ = new views::NativeButton(
@@ -582,11 +543,11 @@ void PageInfoWindow::Init(Profile* profile,
}
}
-views::View* PageInfoWindow::CreateGeneralTabView() {
+views::View* PageInfoWindowWin::CreateGeneralTabView() {
return new views::View();
}
-views::View* PageInfoWindow::CreateSecurityTabView(
+views::View* PageInfoWindowWin::CreateSecurityTabView(
Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
@@ -595,28 +556,28 @@ views::View* PageInfoWindow::CreateSecurityTabView(
return new SecurityTabView(profile, url, ssl, page_type, show_history);
}
-void PageInfoWindow::Show() {
+void PageInfoWindowWin::Show() {
window()->Show();
opened_window_count_++;
}
-int PageInfoWindow::GetDialogButtons() const {
+int PageInfoWindowWin::GetDialogButtons() const {
return MessageBoxFlags::DIALOGBUTTON_CANCEL;
}
-std::wstring PageInfoWindow::GetWindowTitle() const {
+std::wstring PageInfoWindowWin::GetWindowTitle() const {
return l10n_util::GetString(IDS_PAGEINFO_WINDOW_TITLE);
}
-std::wstring PageInfoWindow::GetWindowName() const {
+std::wstring PageInfoWindowWin::GetWindowName() const {
return prefs::kPageInfoWindowPlacement;
}
-views::View* PageInfoWindow::GetContentsView() {
+views::View* PageInfoWindowWin::GetContentsView() {
return contents_;
}
-void PageInfoWindow::ButtonPressed(views::Button* sender) {
+void PageInfoWindowWin::ButtonPressed(views::Button* sender) {
if (sender == cert_info_button_) {
DCHECK(cert_id_ != 0);
ShowCertDialog(cert_id_);
@@ -625,16 +586,10 @@ void PageInfoWindow::ButtonPressed(views::Button* sender) {
}
}
-void PageInfoWindow::CalculateWindowBounds(gfx::Rect* bounds) {
+void PageInfoWindowWin::CalculateWindowBounds(gfx::Rect* bounds) {
const int kDefaultOffset = 15;
-#if defined(OS_WIN)
gfx::Rect monitor_bounds(win_util::GetMonitorBoundsForRect(*bounds));
-#else
- gfx::Rect monitor_bounds;
- NOTIMPLEMENTED();
-#endif
-
if (monitor_bounds.IsEmpty())
return;
@@ -666,8 +621,7 @@ void PageInfoWindow::CalculateWindowBounds(gfx::Rect* bounds) {
bounds->Offset(x_offset, y_offset);
}
-void PageInfoWindow::ShowCertDialog(int cert_id) {
-#if defined(OS_WIN)
+void PageInfoWindowWin::ShowCertDialog(int cert_id) {
scoped_refptr<net::X509Certificate> cert;
CertStore::GetSharedInstance()->RetrieveCert(cert_id, &cert);
if (!cert.get()) {
@@ -693,5 +647,4 @@ void PageInfoWindow::ShowCertDialog(int cert_id) {
// This next call blocks but keeps processing windows messages, making it
// modal to the browser window.
BOOL rv = ::CryptUIDlgViewCertificate(&view_info, &properties_changed);
-#endif
}
diff --git a/chrome/browser/views/page_info_window.h b/chrome/browser/views/page_info_window_win.h
index a7d1ca1..fba4a48 100644
--- a/chrome/browser/views/page_info_window.h
+++ b/chrome/browser/views/page_info_window_win.h
@@ -1,10 +1,11 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// 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.
-#ifndef CHROME_BROWSER_VIEWS_PAGE_INFO_WINDOW_H_
-#define CHROME_BROWSER_VIEWS_PAGE_INFO_WINDOW_H_
+#ifndef CHROME_BROWSER_VIEWS_PAGE_INFO_WINDOW_WIN_H__
+#define CHROME_BROWSER_VIEWS_PAGE_INFO_WINDOW_WIN_H__
+#include "chrome/browser/page_info_window.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
#include "googleurl/src/gurl.h"
#include "views/controls/button/button.h"
@@ -23,44 +24,29 @@ class PageInfoContentView;
class PrefService;
class Profile;
class X509Certificate;
+class SecurityTabView;
-class PageInfoWindow : public views::DialogDelegate,
- public views::ButtonListener {
+class PageInfoWindowWin : public PageInfoWindow,
+ public views::DialogDelegate,
+ public views::ButtonListener {
public:
- enum TabID {
- GENERAL = 0,
- SECURITY,
+ // We need access to PageInfoWindow::GetIssuerName() which is protected
+ friend class SecurityTabView;
- };
-
- // Creates and shows a new page info window for the main page.
- static void CreatePageInfo(Profile* profile,
- NavigationEntry* nav_entry,
- HWND parent_hwnd,
- TabID tab);
-
- // Creates and shows a new page info window for the frame at |url| with the
- // specified SSL information.
- static void CreateFrameInfo(Profile* profile,
- const GURL& url,
- const NavigationEntry::SSLStatus& ssl,
- HWND parent_hwnd,
- TabID tab);
-
- static void RegisterPrefs(PrefService* prefs);
-
- PageInfoWindow();
- virtual ~PageInfoWindow();
+ PageInfoWindowWin();
+ virtual ~PageInfoWindowWin();
+ // This is the main initializer that creates the window.
virtual void Init(Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
NavigationEntry::PageType page_type,
bool show_history,
- HWND parent);
+ gfx::NativeView parent);
// views::Window overridden method.
- void Show();
+ virtual void Show();
+ virtual void ShowCertDialog(int cert_id);
// views::ButtonListener method.
virtual void ButtonPressed(views::Button* sender);
@@ -72,8 +58,8 @@ class PageInfoWindow : public views::DialogDelegate,
virtual views::View* GetContentsView();
private:
- views::View* CreateGeneralTabView();
- views::View* CreateSecurityTabView(
+ virtual views::View* CreateGeneralTabView();
+ virtual views::View* CreateSecurityTabView(
Profile* profile,
const GURL& url,
const NavigationEntry::SSLStatus& ssl,
@@ -84,21 +70,15 @@ class PageInfoWindow : public views::DialogDelegate,
// from its original location.
void CalculateWindowBounds(gfx::Rect* bounds);
- // Shows various information for the specified certificate in a new dialog.
- void ShowCertDialog(int cert_id);
-
views::NativeButton* cert_info_button_;
- // The id of the server cert for this page (0 means no cert).
- int cert_id_;
-
// The page info contents.
PageInfoContentView* contents_;
// A counter of how many page info windows are currently opened.
static int opened_window_count_;
- DISALLOW_COPY_AND_ASSIGN(PageInfoWindow);
+ DISALLOW_COPY_AND_ASSIGN(PageInfoWindowWin);
};
-#endif // #define CHROME_BROWSER_VIEWS_PAGE_INFO_WINDOW_H_
+#endif // #define CHROME_BROWSER_VIEWS_PAGE_INFO_WINDOW_WIN_H__
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 8c0a95a..73923e4 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -226,14 +226,6 @@
'-o', '<(grit_out_dir)',
'-D', '<(chrome_build)'
],
- 'conditons': [
- ['VAR=="foo"', {
- 'action': [
- 'extra',
- 'arguments',
- ],
- }]
- ],
'conditions': [
['linux2==1', {
'action': ['-D', 'linux2'],
@@ -752,6 +744,10 @@
'browser/cocoa/location_bar_view_mac.mm',
'browser/cocoa/menu_localizer.h',
'browser/cocoa/menu_localizer.mm',
+ 'browser/cocoa/page_info_window_controller.h',
+ 'browser/cocoa/page_info_window_controller.mm',
+ 'browser/cocoa/page_info_window_mac.h',
+ 'browser/cocoa/page_info_window_mac.mm',
'browser/cocoa/preferences_localizer.h',
'browser/cocoa/preferences_localizer.mm',
'browser/cocoa/preferences_window_controller.h',
@@ -1157,6 +1153,8 @@
'browser/options_page_base.cc',
'browser/options_page_base.h',
'browser/options_window.h',
+ 'browser/page_info_window.cc',
+ 'browser/page_info_window.h',
'browser/page_state.cc',
'browser/page_state.h',
'browser/password_manager/encryptor_linux.cc',
@@ -1570,8 +1568,8 @@
'browser/views/options/passwords_exceptions_window_view.h',
'browser/views/options/passwords_page_view.cc',
'browser/views/options/passwords_page_view.h',
- 'browser/views/page_info_window.cc',
- 'browser/views/page_info_window.h',
+ 'browser/views/page_info_window_win.cc',
+ 'browser/views/page_info_window_win.h',
'browser/views/repost_form_warning_view.cc',
'browser/views/repost_form_warning_view.h',
'browser/views/restart_message_box.cc',
@@ -1768,6 +1766,7 @@
],
'link_settings': {
'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/SecurityInterface.framework',
'$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
],
},
@@ -2349,6 +2348,7 @@
'app/nibs/en.lproj/FindBar.xib',
'app/nibs/en.lproj/FirstRunDialog.xib',
'app/nibs/en.lproj/MainMenu.xib',
+ 'app/nibs/en.lproj/PageInfo.xib',
'app/nibs/en.lproj/Preferences.xib',
'app/nibs/en.lproj/SaveAccessoryView.xib',
'app/nibs/en.lproj/TabContents.xib',
@@ -2369,6 +2369,8 @@
'app/theme/o2_search.png',
'app/theme/o2_star.png',
'app/theme/otr_icon.pdf',
+ 'app/theme/pageinfo_bad.png',
+ 'app/theme/pageinfo_good.png',
'app/theme/reload.pdf',
'app/theme/sadtab.png',
'app/theme/star.pdf',
diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h
index 04d11c6e..07f1e1e 100644
--- a/chrome/common/temp_scaffolding_stubs.h
+++ b/chrome/common/temp_scaffolding_stubs.h
@@ -376,25 +376,6 @@ class RepostFormWarningDialog {
virtual ~RepostFormWarningDialog() { }
};
-#if !defined(TOOLKIT_VIEWS)
-class PageInfoWindow {
- public:
- enum TabID {
- GENERAL = 0,
- SECURITY,
- };
- static void CreatePageInfo(Profile* profile, NavigationEntry* nav_entry,
- gfx::NativeView parent_hwnd, TabID tab) {
- NOTIMPLEMENTED();
- }
- static void CreateFrameInfo(Profile* profile, const GURL& url,
- const NavigationEntry::SSLStatus& ssl,
- gfx::NativeView parent_hwnd, TabID tab) {
- NOTIMPLEMENTED();
- }
-};
-#endif
-
class FontsLanguagesWindowView {
public:
explicit FontsLanguagesWindowView(Profile* profile) { NOTIMPLEMENTED(); }