summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-21 21:42:46 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-21 21:42:46 +0000
commitcd1b1db449f9bd1ea6d75bf38562e3a2e72106d9 (patch)
tree09591b0d16869ccccc5e2122aec6db2a07bb115b
parent3dc5eac55b0c9d69a3491296c34270d819506e2d (diff)
downloadchromium_src-cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9.zip
chromium_src-cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9.tar.gz
chromium_src-cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9.tar.bz2
Make links in the cocoa about dialog clickable. (Try #2).
Once again, we're changing the implementation from an NSTextField to an NSTextView. The text is no longer editable, the margins have been fixed to not be standard cocoa margins and the font is explicitly set to Lucida Grande. After talking with jrg, I think the text should be selectable. BUG=20493 BUG=20855 Review URL: http://codereview.chromium.org/216028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26737 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/nibs/About.xib455
-rw-r--r--chrome/browser/cocoa/about_window_controller.h7
-rw-r--r--chrome/browser/cocoa/about_window_controller.mm54
-rw-r--r--chrome/browser/cocoa/about_window_controller_unittest.mm28
4 files changed, 460 insertions, 84 deletions
diff --git a/chrome/app/nibs/About.xib b/chrome/app/nibs/About.xib
index 6b5bd0c..fac9cf4 100644
--- a/chrome/app/nibs/About.xib
+++ b/chrome/app/nibs/About.xib
@@ -2,13 +2,13 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">9L30</string>
+ <string key="IBDocument.SystemVersion">9L31a</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
<string key="IBDocument.AppKitVersion">949.54</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="3"/>
+ <integer value="62"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -48,42 +48,6 @@
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="564072719">
- <reference key="NSNextResponder" ref="498033215"/>
- <int key="NSvFlags">266</int>
- <string key="NSFrame">{{17, 52}, {416, 41}}</string>
- <reference key="NSSuperview" ref="498033215"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="965526644">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">1346502656</int>
- <string key="NSContents">textblock</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>
- <reference key="NSControlView" ref="564072719"/>
- <object class="NSColor" key="NSBackgroundColor">
- <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">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">textColor</string>
- <object class="NSColor" key="NSColor" id="568235873">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MAA</bytes>
- </object>
- </object>
- </object>
- </object>
<object class="NSCustomView" id="4268204">
<reference key="NSNextResponder" ref="498033215"/>
<int key="NSvFlags">266</int>
@@ -99,13 +63,17 @@
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">4326400</int>
<string key="NSContents">version</string>
- <reference key="NSSupport" ref="26"/>
+ <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>
<reference key="NSControlView" ref="171870711"/>
<object class="NSColor" key="NSBackgroundColor" id="782671173">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
- <object class="NSColor" key="NSColor">
+ <object class="NSColor" key="NSColor" id="351809317">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
</object>
@@ -114,7 +82,10 @@
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
- <reference key="NSColor" ref="568235873"/>
+ <object class="NSColor" key="NSColor" id="568235873">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
</object>
</object>
</object>
@@ -266,6 +237,314 @@
<reference key="NSSuperview" ref="498033215"/>
<string key="NSClassName">NSView</string>
</object>
+ <object class="NSScrollView" id="1057129711">
+ <reference key="NSNextResponder" ref="498033215"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSClipView" id="945146224">
+ <reference key="NSNextResponder" ref="1057129711"/>
+ <int key="NSvFlags">2304</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextView" id="674191027">
+ <reference key="NSNextResponder" ref="945146224"/>
+ <int key="NSvFlags">2322</int>
+ <string key="NSFrameSize">{435, 96}</string>
+ <reference key="NSSuperview" ref="945146224"/>
+ <object class="NSTextContainer" key="NSTextContainer" id="93702899">
+ <object class="NSLayoutManager" key="NSLayoutManager">
+ <object class="NSTextStorage" key="NSTextStorage">
+ <object class="NSMutableString" key="NSString">
+ <characters key="NS.bytes">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum Et harumd und lookum like Greek to me, dereud facilis est er expedit distinct. Nam liber te conscient to factor tum poen legum odioque civiuda</characters>
+ </object>
+ <object class="NSMutableArray" key="NSAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSFont</string>
+ <string>NSParagraphStyle</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSFont">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">1.000000e+01</double>
+ <int key="NSfFlags">2843</int>
+ </object>
+ <object class="NSParagraphStyle">
+ <int key="NSAlignment">3</int>
+ <object class="NSArray" key="NSTabStops">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextTab" id="27870836">
+ <double key="NSLocation">0.000000e+00</double>
+ </object>
+ <object class="NSTextTab" id="592792267">
+ <double key="NSLocation">5.600000e+01</double>
+ </object>
+ <object class="NSTextTab" id="126551911">
+ <double key="NSLocation">1.120000e+02</double>
+ </object>
+ <object class="NSTextTab" id="191893236">
+ <double key="NSLocation">1.680000e+02</double>
+ </object>
+ <object class="NSTextTab" id="951223422">
+ <double key="NSLocation">2.240000e+02</double>
+ </object>
+ <object class="NSTextTab" id="809783613">
+ <double key="NSLocation">2.800000e+02</double>
+ </object>
+ <object class="NSTextTab" id="860076538">
+ <double key="NSLocation">3.360000e+02</double>
+ </object>
+ <object class="NSTextTab" id="1072606669">
+ <double key="NSLocation">3.920000e+02</double>
+ </object>
+ <object class="NSTextTab" id="979981889">
+ <double key="NSLocation">4.480000e+02</double>
+ </object>
+ <object class="NSTextTab" id="47697203">
+ <double key="NSLocation">5.040000e+02</double>
+ </object>
+ <object class="NSTextTab" id="291259712">
+ <double key="NSLocation">5.600000e+02</double>
+ </object>
+ <object class="NSTextTab" id="246821840">
+ <double key="NSLocation">6.160000e+02</double>
+ </object>
+ <object class="NSTextTab" id="957891941">
+ <double key="NSLocation">6.720000e+02</double>
+ </object>
+ <object class="NSTextTab" id="535640224">
+ <double key="NSLocation">7.280000e+02</double>
+ </object>
+ <object class="NSTextTab" id="984477694">
+ <double key="NSLocation">7.840000e+02</double>
+ </object>
+ <object class="NSTextTab" id="824253541">
+ <double key="NSLocation">8.400000e+02</double>
+ </object>
+ <object class="NSTextTab" id="130024996">
+ <double key="NSLocation">8.960000e+02</double>
+ </object>
+ <object class="NSTextTab" id="164911959">
+ <double key="NSLocation">9.520000e+02</double>
+ </object>
+ <object class="NSTextTab" id="113856442">
+ <double key="NSLocation">1.008000e+03</double>
+ </object>
+ <object class="NSTextTab" id="852624236">
+ <double key="NSLocation">1.064000e+03</double>
+ </object>
+ <object class="NSTextTab" id="252665410">
+ <double key="NSLocation">1.120000e+03</double>
+ </object>
+ <object class="NSTextTab" id="131293233">
+ <double key="NSLocation">1.176000e+03</double>
+ </object>
+ <object class="NSTextTab" id="645991082">
+ <double key="NSLocation">1.232000e+03</double>
+ </object>
+ <object class="NSTextTab" id="825878467">
+ <double key="NSLocation">1.288000e+03</double>
+ </object>
+ <object class="NSTextTab" id="413072629">
+ <double key="NSLocation">1.344000e+03</double>
+ </object>
+ <object class="NSTextTab" id="645290501">
+ <double key="NSLocation">1.400000e+03</double>
+ </object>
+ <object class="NSTextTab" id="591266568">
+ <double key="NSLocation">1.456000e+03</double>
+ </object>
+ <object class="NSTextTab" id="676235716">
+ <double key="NSLocation">1.512000e+03</double>
+ </object>
+ <object class="NSTextTab" id="132049243">
+ <double key="NSLocation">1.568000e+03</double>
+ </object>
+ <object class="NSTextTab" id="574654454">
+ <double key="NSLocation">1.624000e+03</double>
+ </object>
+ <object class="NSTextTab" id="547640115">
+ <double key="NSLocation">1.680000e+03</double>
+ </object>
+ <object class="NSTextTab" id="159917081">
+ <double key="NSLocation">1.736000e+03</double>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSFont</string>
+ <string>NSParagraphStyle</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSFont">
+ <string key="NSName">LucidaGrande-Bold</string>
+ <double key="NSSize">1.000000e+01</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <object class="NSParagraphStyle">
+ <int key="NSAlignment">3</int>
+ <object class="NSArray" key="NSTabStops">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="27870836"/>
+ <reference ref="592792267"/>
+ <reference ref="126551911"/>
+ <reference ref="191893236"/>
+ <reference ref="951223422"/>
+ <reference ref="809783613"/>
+ <reference ref="860076538"/>
+ <reference ref="1072606669"/>
+ <reference ref="979981889"/>
+ <reference ref="47697203"/>
+ <reference ref="291259712"/>
+ <reference ref="246821840"/>
+ <reference ref="957891941"/>
+ <reference ref="535640224"/>
+ <reference ref="984477694"/>
+ <reference ref="824253541"/>
+ <reference ref="130024996"/>
+ <reference ref="164911959"/>
+ <reference ref="113856442"/>
+ <reference ref="852624236"/>
+ <reference ref="252665410"/>
+ <reference ref="131293233"/>
+ <reference ref="645991082"/>
+ <reference ref="825878467"/>
+ <reference ref="413072629"/>
+ <reference ref="645290501"/>
+ <reference ref="591266568"/>
+ <reference ref="676235716"/>
+ <reference ref="132049243"/>
+ <reference ref="574654454"/>
+ <reference ref="547640115"/>
+ <reference ref="159917081"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableData" key="NSAttributeInfo">
+ <bytes key="NS.bytes">GQAEAQgADAEiAAcBhAQAA</bytes>
+ </object>
+ <nil key="NSDelegate"/>
+ </object>
+ <object class="NSMutableArray" key="NSTextContainers">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="93702899"/>
+ </object>
+ <int key="NSLMFlags">6</int>
+ <nil key="NSDelegate"/>
+ </object>
+ <reference key="NSTextView" ref="674191027"/>
+ <double key="NSWidth">4.350000e+02</double>
+ <int key="NSTCFlags">1</int>
+ </object>
+ <object class="NSTextViewSharedData" key="NSSharedData">
+ <int key="NSFlags">10981</int>
+ <object class="NSColor" key="NSBackgroundColor" id="1044925321">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <reference key="NSInsertionColor" ref="568235873"/>
+ <object class="NSDictionary" key="NSSelectedAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSBackgroundColor</string>
+ <string>NSColor</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextBackgroundColor</string>
+ <reference key="NSColor" ref="351809317"/>
+ </object>
+ <object class="NSColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">selectedTextColor</string>
+ <reference key="NSColor" ref="568235873"/>
+ </object>
+ </object>
+ </object>
+ <nil key="NSMarkedAttributes"/>
+ <object class="NSDictionary" key="NSLinkAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSColor</string>
+ <string>NSUnderline</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MCAwIDEAA</bytes>
+ </object>
+ <integer value="1"/>
+ </object>
+ </object>
+ <nil key="NSDefaultParagraphStyle"/>
+ </object>
+ <int key="NSTVFlags">6</int>
+ <string key="NSMaxSize">{463, 1e+07}</string>
+ <string key="NSMinize">{223, 85}</string>
+ <nil key="NSDelegate"/>
+ </object>
+ </object>
+ <string key="NSFrameSize">{435, 41}</string>
+ <reference key="NSSuperview" ref="1057129711"/>
+ <reference key="NSNextKeyView" ref="674191027"/>
+ <reference key="NSDocView" ref="674191027"/>
+ <reference key="NSBGColor" ref="1044925321"/>
+ <object class="NSCursor" key="NSCursor">
+ <string key="NSHotSpot">{4, -5}</string>
+ <int key="NSCursorType">1</int>
+ </object>
+ <int key="NScvFlags">2</int>
+ </object>
+ <object class="NSScroller" id="410230817">
+ <reference key="NSNextResponder" ref="1057129711"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{-100, -100}, {15, 41}}</string>
+ <reference key="NSSuperview" ref="1057129711"/>
+ <bool key="NSEnabled">YES</bool>
+ <reference key="NSTarget" ref="1057129711"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSPercent">4.270833e-01</double>
+ </object>
+ <object class="NSScroller" id="138142032">
+ <reference key="NSNextResponder" ref="1057129711"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{-100, -100}, {87, 18}}</string>
+ <reference key="NSSuperview" ref="1057129711"/>
+ <int key="NSsFlags">1</int>
+ <reference key="NSTarget" ref="1057129711"/>
+ <string key="NSAction">_doScroller:</string>
+ <double key="NSCurValue">1.000000e+00</double>
+ <double key="NSPercent">9.456522e-01</double>
+ </object>
+ </object>
+ <string key="NSFrame">{{8, 52}, {435, 41}}</string>
+ <reference key="NSSuperview" ref="498033215"/>
+ <reference key="NSNextKeyView" ref="945146224"/>
+ <int key="NSsFlags">64</int>
+ <reference key="NSVScroller" ref="410230817"/>
+ <reference key="NSHScroller" ref="138142032"/>
+ <reference key="NSContentView" ref="945146224"/>
+ </object>
</object>
<string key="NSFrameSize">{450, 246}</string>
<reference key="NSSuperview"/>
@@ -349,14 +628,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">legalBlock_</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="564072719"/>
- </object>
- <int key="connectionID">46</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">updateBlock_</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="979682390"/>
@@ -403,6 +674,30 @@
</object>
<int key="connectionID">61</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">legalText_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="674191027"/>
+ </object>
+ <int key="connectionID">66</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">legalBlock_</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1057129711"/>
+ </object>
+ <int key="connectionID">68</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="674191027"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">69</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -449,26 +744,12 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="4268204"/>
- <reference ref="564072719"/>
<reference ref="979682390"/>
+ <reference ref="1057129711"/>
</object>
<reference key="parent" ref="820943852"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="564072719"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="965526644"/>
- </object>
- <reference key="parent" ref="498033215"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">15</int>
- <reference key="object" ref="965526644"/>
- <reference key="parent" ref="564072719"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">34</int>
<reference key="object" ref="4268204"/>
<object class="NSMutableArray" key="children">
@@ -599,6 +880,32 @@
<reference key="object" ref="870089784"/>
<reference key="parent" ref="309109286"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">62</int>
+ <reference key="object" ref="1057129711"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="410230817"/>
+ <reference ref="138142032"/>
+ <reference ref="674191027"/>
+ </object>
+ <reference key="parent" ref="498033215"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">63</int>
+ <reference key="object" ref="410230817"/>
+ <reference key="parent" ref="1057129711"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">64</int>
+ <reference key="object" ref="138142032"/>
+ <reference key="parent" ref="1057129711"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">65</int>
+ <reference key="object" ref="674191027"/>
+ <reference key="parent" ref="1057129711"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -612,7 +919,6 @@
<string>11.IBPluginDependency</string>
<string>12.IBPluginDependency</string>
<string>13.IBPluginDependency</string>
- <string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.IBPluginDependency</string>
<string>3.IBEditorWindowLastContentRect</string>
@@ -628,8 +934,11 @@
<string>58.IBPluginDependency</string>
<string>59.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
+ <string>62.IBPluginDependency</string>
+ <string>63.IBPluginDependency</string>
+ <string>64.IBPluginDependency</string>
+ <string>65.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
- <string>8.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -642,7 +951,6 @@
<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>{{524, 526}, {450, 246}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{524, 526}, {450, 246}}</string>
@@ -662,6 +970,9 @@
<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">
@@ -684,7 +995,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">61</int>
+ <int key="maxID">69</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -702,11 +1013,10 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>backgroundView_</string>
<string>legalBlock_</string>
+ <string>legalText_</string>
<string>logoView_</string>
<string>spinner_</string>
- <string>upToDate_</string>
<string>updateBlock_</string>
- <string>updateCompleted_</string>
<string>updateNowButton_</string>
<string>updateStatusIndicator_</string>
<string>updateText_</string>
@@ -715,12 +1025,11 @@
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>BackgroundTileView</string>
- <string>NSTextField</string>
+ <string>NSView</string>
+ <string>NSTextView</string>
<string>NSImageView</string>
<string>NSProgressIndicator</string>
- <string>NSTextField</string>
<string>NSView</string>
- <string>NSTextField</string>
<string>NSButton</string>
<string>NSImageView</string>
<string>NSTextField</string>
diff --git a/chrome/browser/cocoa/about_window_controller.h b/chrome/browser/cocoa/about_window_controller.h
index f9c7528..63ed4f1 100644
--- a/chrome/browser/cocoa/about_window_controller.h
+++ b/chrome/browser/cocoa/about_window_controller.h
@@ -11,6 +11,9 @@
@class BackgroundTileView;
+// Returns an NSAttributedString that contains the locale specific legal text.
+NSAttributedString* BuildAboutWindowLegalTextBlock();
+
// A window controller that handles the branded (Chrome.app) about
// window. The branded about window has a few features beyond the
// standard Cocoa about panel. For example, opening the about window
@@ -21,7 +24,8 @@
IBOutlet NSTextField* version_;
IBOutlet BackgroundTileView* backgroundView_;
IBOutlet NSImageView* logoView_;
- IBOutlet NSTextField* legalBlock_;
+ IBOutlet NSView* legalBlock_;
+ IBOutlet NSTextView* legalText_;
IBOutlet NSView* updateBlock_; // Holds everything related to updates
IBOutlet NSProgressIndicator* spinner_;
IBOutlet NSImageView* updateStatusIndicator_;
@@ -41,6 +45,7 @@
@interface AboutWindowController (JustForTesting)
+- (NSTextView*)legalText;
- (NSButton*)updateButton;
- (NSTextField*)updateText;
@end
diff --git a/chrome/browser/cocoa/about_window_controller.mm b/chrome/browser/cocoa/about_window_controller.mm
index 2dff4ed..f6fe70d 100644
--- a/chrome/browser/cocoa/about_window_controller.mm
+++ b/chrome/browser/cocoa/about_window_controller.mm
@@ -10,6 +10,7 @@
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#import "chrome/app/keystone_glue.h"
+#include "chrome/browser/browser_list.h"
#import "chrome/browser/cocoa/about_window_controller.h"
#import "chrome/browser/cocoa/background_tile_view.h"
#include "chrome/browser/cocoa/restart_browser.h"
@@ -63,9 +64,14 @@ void AttributedStringAppendHyperlink(NSMutableAttributedString* attr_str,
[attr_str addAttribute:NSUnderlineStyleAttributeName
value:[NSNumber numberWithInt:NSSingleUnderlineStyle]
range:range];
+ [attr_str addAttribute:NSCursorAttributeName
+ value:[NSCursor pointingHandCursor]
+ range:range];
}
-NSAttributedString* BuildLegalTextBlock() {
+} // namespace
+
+NSAttributedString* BuildAboutWindowLegalTextBlock() {
// Windows builds this up in a very complex way, we're just trying to model
// it the best we can to get all the information in (they actually do it
// but created Labels and Links that they carefully place to make it appear
@@ -162,7 +168,7 @@ NSAttributedString* BuildLegalTextBlock() {
NSString* about_terms = base::SysWideToNSString(w_about_terms);
NSString* terms_link_text = l10n_util::GetNSString(IDS_TERMS_OF_SERVICE);
- AttributedStringAppendString(legal_block, @"\n");
+ AttributedStringAppendString(legal_block, @"\n\n");
sub_str = [about_terms substringToIndex:url_offsets[0]];
AttributedStringAppendString(legal_block, sub_str);
AttributedStringAppendHyperlink(legal_block, terms_link_text, kTOS);
@@ -170,12 +176,17 @@ NSAttributedString* BuildLegalTextBlock() {
AttributedStringAppendString(legal_block, sub_str);
#endif // defined(GOOGLE_CHROME_BUILD)
+ // We need to explicitly select Lucida Grande because once we click on
+ // the NSTextView, it changes to Helvetica 12 otherwise.
+ NSRange string_range = NSMakeRange(0, [legal_block length]);
+ [legal_block addAttribute:NSFontAttributeName
+ value:[NSFont labelFontOfSize:11]
+ range:string_range];
+
[legal_block endEditing];
return legal_block;
}
-} // namespace
-
@implementation AboutWindowController
- (id)initWithWindowNibName:(NSString*)nibName {
@@ -209,8 +220,22 @@ NSAttributedString* BuildLegalTextBlock() {
DCHECK(logoImage);
[logoView_ setImage:logoImage];
- // Put the legal text into
- [legalBlock_ setAttributedStringValue:BuildLegalTextBlock()];
+ [[legalText_ textStorage]
+ setAttributedString:BuildAboutWindowLegalTextBlock()];
+
+ // Resize our text view now so that the |updateShift| below is set
+ // correctly. The about box has its controls manually positioned, so we need
+ // to calculate how much larger (or smaller) our text box is and store that
+ // difference in |legalShift|. We do something similar with |updateShift|
+ // below, which is either 0, or the amount of space to offset the window size
+ // because the view that contains the update button has been removed because
+ // this build doesn't have KeyStone.
+ NSRect oldLegalRect = [legalBlock_ frame];
+ [legalText_ sizeToFit];
+ NSRect newRect = oldLegalRect;
+ newRect.size.height = [legalText_ frame].size.height;
+ [legalBlock_ setFrame:newRect];
+ CGFloat legalShift = newRect.size.height - oldLegalRect.size.height;
KeystoneGlue* keystone = [self defaultKeystoneGlue];
CGFloat updateShift = 0.0;
@@ -228,10 +253,6 @@ NSAttributedString* BuildLegalTextBlock() {
}
// Adjust the sizes/locations.
-
- CGFloat legalShift =
- [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:legalBlock_];
-
NSRect rect = [legalBlock_ frame];
rect.origin.y -= updateShift;
[legalBlock_ setFrame:rect];
@@ -380,6 +401,19 @@ NSAttributedString* BuildLegalTextBlock() {
}
}
+- (BOOL)textView:(NSTextView *)aTextView
+ clickedOnLink:(id)link
+ atIndex:(NSUInteger)charIndex {
+ BrowserList::GetLastActive()->
+ OpenURL(GURL([link UTF8String]), GURL(), NEW_WINDOW,
+ PageTransition::LINK);
+ return YES;
+}
+
+- (NSTextView*)legalText {
+ return legalText_;
+}
+
- (NSButton*)updateButton {
return updateNowButton_;
}
diff --git a/chrome/browser/cocoa/about_window_controller_unittest.mm b/chrome/browser/cocoa/about_window_controller_unittest.mm
index 462824d..2ce86ac 100644
--- a/chrome/browser/cocoa/about_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/about_window_controller_unittest.mm
@@ -26,6 +26,34 @@ class AboutWindowControllerTest : public PlatformTest {
scoped_nsobject<AboutWindowController> about_window_controller_;
};
+TEST_F(AboutWindowControllerTest, TestCopyright) {
+ NSString* text = [BuildAboutWindowLegalTextBlock() string];
+
+ // Make sure we have the word "Copyright" in it, which is present in all
+ // locales.
+ NSRange range = [text rangeOfString:@"Copyright"];
+ EXPECT_NE(NSNotFound, range.location);
+}
+
+TEST_F(AboutWindowControllerTest, RemovesLinkAnchors) {
+ NSString* text = [BuildAboutWindowLegalTextBlock() string];
+
+ // Make sure that we removed the "BEGIN_LINK" and "END_LINK" anchors.
+ NSRange range = [text rangeOfString:@"BEGIN_LINK"];
+ EXPECT_EQ(NSNotFound, range.location);
+
+ range = [text rangeOfString:@"END_LINK"];
+ EXPECT_EQ(NSNotFound, range.location);
+}
+
+TEST_F(AboutWindowControllerTest, AwakeNibSetsString) {
+ NSAttributedString* legal_text = BuildAboutWindowLegalTextBlock();
+ NSAttributedString* text_storage =
+ [[about_window_controller_ legalText] textStorage];
+
+ EXPECT_TRUE([legal_text isEqualToAttributedString:text_storage]);
+}
+
TEST_F(AboutWindowControllerTest, TestButton) {
NSButton* button = [about_window_controller_ updateButton];
ASSERT_TRUE(button);