From 0cbacf170644b4efce6c98b6637bba942b9110a5 Mon Sep 17 00:00:00 2001 From: "thomasvl@chromium.org" Date: Thu, 17 Sep 2009 21:41:04 +0000 Subject: Reverting 26482. relied on making the field editable which really doesn't work for legal text you show a user BUG=20493 BUG=20855 BUG=22179 BUG=22180 Review URL: http://codereview.chromium.org/212010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26488 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/nibs/About.xib | 293 ++++++------------------ chrome/browser/cocoa/about_window_controller.h | 3 +- chrome/browser/cocoa/about_window_controller.mm | 29 +-- 3 files changed, 79 insertions(+), 246 deletions(-) diff --git a/chrome/app/nibs/About.xib b/chrome/app/nibs/About.xib index 123a99e..6b5bd0c 100644 --- a/chrome/app/nibs/About.xib +++ b/chrome/app/nibs/About.xib @@ -2,13 +2,13 @@ 1050 - 9L31a + 9L30 677 949.54 353.00 YES - + YES @@ -48,163 +48,41 @@ 256 YES - + - 256 - - YES - - - 2304 - - YES - - - 2322 - - YES - - YES - Apple HTML pasteboard type - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - Apple URL pasteboard type - CorePasteboardFlavorType 0x6D6F6F76 - CorePasteboardFlavorType 0x75726C20 - NSColor pasteboard type - NSFilenamesPboardType - NSStringPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT RTFD pasteboard type - NeXT Rich Text Format v1.0 pasteboard type - NeXT TIFF v4.0 pasteboard type - NeXT font pasteboard type - NeXT ruler pasteboard type - WebURLsWithTitlesPboardType - - - {410, 0} - - - - - - - - - - - YES - - - 6 - - - - 4.100000e+02 - 1 - - - 2055 - - 3 - MQA - - - 3 - MAA - - - YES - - YES - NSBackgroundColor - NSColor - - - YES - - 6 - System - selectedTextBackgroundColor - - 3 - MC42NjY2NjY2OQA - - - - 6 - System - selectedTextColor - - - - - - - YES - - YES - NSColor - NSUnderline - - - YES - - 1 - MCAwIDEAA - - - - - - - 6 - {900, 1e+07} - {3, 0} - - - - {410, 41} - - - - - - {4, -5} - 1 - - 2 + 266 + {{17, 52}, {416, 41}} + + YES + + -2080244224 + 1346502656 + textblock + + LucidaGrande + 1.100000e+01 + 3100 - - - 256 - {{-100, -100}, {15, 39}} - - - _doScroller: - 3.823529e-01 + + + 6 + System + textBackgroundColor + + 3 + MQA + - - - 256 - {{-100, -100}, {87, 18}} - - 1 - - _doScroller: - 1.000000e+00 - 9.456522e-01 + + 6 + System + textColor + + 3 + MAA + - {{20, 52}, {410, 41}} - - - 0 - - - @@ -221,17 +99,16 @@ 68288064 4326400 version - - LucidaGrande - 1.100000e+01 - 3100 - + 6 System controlColor - + + 3 + MC42NjY2NjY2OQA + 6 @@ -472,6 +349,14 @@ + legalBlock_ + + + + 46 + + + updateBlock_ @@ -518,30 +403,6 @@ 61 - - - delegate - - - - 72 - - - - legalBlock_ - - - - 73 - - - - legalText_ - - - - 74 - @@ -588,12 +449,26 @@ YES + - + 8 + + + YES + + + + + + 15 + + + + 34 @@ -724,32 +599,6 @@ - - 67 - - - YES - - - - - - - - 68 - - - - - 69 - - - - - 70 - - - @@ -763,6 +612,7 @@ 11.IBPluginDependency 12.IBPluginDependency 13.IBPluginDependency + 15.IBPluginDependency 16.IBPluginDependency 17.IBPluginDependency 3.IBEditorWindowLastContentRect @@ -778,11 +628,8 @@ 58.IBPluginDependency 59.IBPluginDependency 6.IBPluginDependency - 67.IBPluginDependency - 68.IBPluginDependency - 69.IBPluginDependency 7.IBPluginDependency - 70.IBPluginDependency + 8.IBPluginDependency YES @@ -795,7 +642,8 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - {{652, 526}, {450, 246}} + com.apple.InterfaceBuilder.CocoaPlugin + {{524, 526}, {450, 246}} com.apple.InterfaceBuilder.CocoaPlugin {{524, 526}, {450, 246}} @@ -814,9 +662,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin @@ -839,7 +684,7 @@ - 74 + 61 @@ -857,10 +702,11 @@ YES backgroundView_ legalBlock_ - legalText_ logoView_ spinner_ + upToDate_ updateBlock_ + updateCompleted_ updateNowButton_ updateStatusIndicator_ updateText_ @@ -869,11 +715,12 @@ YES BackgroundTileView - NSView - NSTextView + NSTextField NSImageView NSProgressIndicator + NSTextField NSView + NSTextField NSButton NSImageView NSTextField diff --git a/chrome/browser/cocoa/about_window_controller.h b/chrome/browser/cocoa/about_window_controller.h index d69a938..f9c7528 100644 --- a/chrome/browser/cocoa/about_window_controller.h +++ b/chrome/browser/cocoa/about_window_controller.h @@ -21,8 +21,7 @@ IBOutlet NSTextField* version_; IBOutlet BackgroundTileView* backgroundView_; IBOutlet NSImageView* logoView_; - IBOutlet NSView* legalBlock_; - IBOutlet NSTextView* legalText_; + IBOutlet NSTextField* legalBlock_; IBOutlet NSView* updateBlock_; // Holds everything related to updates IBOutlet NSProgressIndicator* spinner_; IBOutlet NSImageView* updateStatusIndicator_; diff --git a/chrome/browser/cocoa/about_window_controller.mm b/chrome/browser/cocoa/about_window_controller.mm index 01f21d9..2dff4ed 100644 --- a/chrome/browser/cocoa/about_window_controller.mm +++ b/chrome/browser/cocoa/about_window_controller.mm @@ -10,7 +10,6 @@ #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" @@ -163,7 +162,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\n"); + AttributedStringAppendString(legal_block, @"\n"); sub_str = [about_terms substringToIndex:url_offsets[0]]; AttributedStringAppendString(legal_block, sub_str); AttributedStringAppendHyperlink(legal_block, terms_link_text, kTOS); @@ -210,16 +209,9 @@ NSAttributedString* BuildLegalTextBlock() { DCHECK(logoImage); [logoView_ setImage:logoImage]; - [legalText_ insertText:BuildLegalTextBlock()]; + // Put the legal text into + [legalBlock_ setAttributedStringValue:BuildLegalTextBlock()]; - // Resize our text view now so that the |updateShift| below is set correctly. - 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; if (keystone) { @@ -234,8 +226,12 @@ NSAttributedString* BuildLegalTextBlock() { // (and it's spacing). updateShift = NSMinY([legalBlock_ frame]) - NSMinY([updateBlock_ frame]); } - + // Adjust the sizes/locations. + + CGFloat legalShift = + [GTMUILocalizerAndLayoutTweaker sizeToFitFixedWidthTextField:legalBlock_]; + NSRect rect = [legalBlock_ frame]; rect.origin.y -= updateShift; [legalBlock_ setFrame:rect]; @@ -384,15 +380,6 @@ 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; -} - - (NSButton*)updateButton { return updateNowButton_; } -- cgit v1.1