diff options
-rw-r--r-- | chrome/app/nibs/Preferences.xib | 105 | ||||
-rw-r--r-- | chrome/browser/cocoa/preferences_window_controller.h | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/preferences_window_controller.mm | 21 |
3 files changed, 106 insertions, 22 deletions
diff --git a/chrome/app/nibs/Preferences.xib b/chrome/app/nibs/Preferences.xib index 93b6774..2f0408a 100644 --- a/chrome/app/nibs/Preferences.xib +++ b/chrome/app/nibs/Preferences.xib @@ -9,6 +9,7 @@ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> <integer value="74"/> + <integer value="482"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1700,7 +1701,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="393583039"> - <nil key="NSNextResponder"/> + <reference key="NSNextResponder"/> <int key="NSvFlags">268</int> <object class="NSMutableArray" key="NSSubviews"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -1723,7 +1724,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="20640598"> <reference key="NSNextResponder" ref="393583039"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{17, 290}, {128, 60}}</string> + <string key="NSFrame">{{17, 315}, {128, 60}}</string> <reference key="NSSuperview" ref="393583039"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="101746388"> @@ -1951,7 +1952,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSButton" id="203729106"> <reference key="NSNextResponder" ref="393583039"/> <int key="NSvFlags">268</int> - <string key="NSFrame">{{146, 322}, {184, 32}}</string> + <string key="NSFrame">{{146, 347}, {184, 32}}</string> <reference key="NSSuperview" ref="393583039"/> <bool key="NSEnabled">YES</bool> <object class="NSButtonCell" key="NSCell" id="431766699"> @@ -2035,7 +2036,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSTextField" id="90260648"> <reference key="NSNextResponder" ref="393583039"/> <int key="NSvFlags">266</int> - <string key="NSFrame">{{149, 294}, {364, 28}}</string> + <string key="NSFrame">{{149, 319}, {364, 28}}</string> <reference key="NSSuperview" ref="393583039"/> <bool key="NSEnabled">YES</bool> <object class="NSTextFieldCell" key="NSCell" id="123936632"> @@ -2300,6 +2301,26 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <int key="NSPeriodicInterval">25</int> </object> </object> + <object class="NSButton" id="1022040155"> + <reference key="NSNextResponder" ref="393583039"/> + <int key="NSvFlags">268</int> + <string key="NSFrame">{{152, 294}, {82, 17}}</string> + <reference key="NSSuperview" ref="393583039"/> + <bool key="NSEnabled">YES</bool> + <object class="NSButtonCell" key="NSCell" id="1047338722"> + <int key="NSCellFlags">67239424</int> + <int key="NSCellFlags2">134217728</int> + <string key="NSContents">^IDS_SYNC_RELOGIN_LINK_LABEL</string> + <reference key="NSSupport" ref="445696277"/> + <reference key="NSControlView" ref="1022040155"/> + <int key="NSButtonFlags">-2038284033</int> + <int key="NSButtonFlags2">134</int> + <string key="NSAlternateContents"/> + <string key="NSKeyEquivalent"/> + <int key="NSPeriodicDelay">200</int> + <int key="NSPeriodicInterval">25</int> + </object> + </object> <object class="NSButton" id="865039969"> <reference key="NSNextResponder" ref="393583039"/> <int key="NSvFlags">268</int> @@ -2321,7 +2342,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> </object> - <string key="NSFrameSize">{530, 370}</string> + <string key="NSFrameSize">{530, 395}</string> + <reference key="NSSuperview"/> <string key="NSClassName">NSView</string> </object> <object class="NSCustomView" id="933437956"> @@ -2349,6 +2371,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <string key="NSFrame">{{1, 1}, {515, 402}}</string> <reference key="NSSuperview" ref="14278481"/> + <reference key="NSNextKeyView" ref="772886817"/> <reference key="NSDocView" ref="772886817"/> <object class="NSColor" key="NSBGColor"> <int key="NSColorSpace">3</int> @@ -2379,6 +2402,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <string key="NSFrame">{{-1, 60}, {532, 404}}</string> <reference key="NSSuperview" ref="933437956"/> + <reference key="NSNextKeyView" ref="277407604"/> <int key="NSsFlags">18</int> <reference key="NSVScroller" ref="331420378"/> <reference key="NSHScroller" ref="470087648"/> @@ -3582,14 +3606,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <int key="connectionID">615</int> </object> <object class="IBConnectionRecord"> - <object class="IBOutletConnection" key="connection"> - <string key="label">object3_</string> - <reference key="source" ref="821768455"/> - <reference key="destination" ref="90260648"/> - </object> - <int key="connectionID">616</int> - </object> - <object class="IBConnectionRecord"> <object class="IBActionConnection" key="connection"> <string key="label">showCookies:</string> <reference key="source" ref="1001"/> @@ -3613,6 +3629,38 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> <int key="connectionID">621</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">doSyncReauthentication:</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="1022040155"/> + </object> + <int key="connectionID">624</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">object3_</string> + <reference key="source" ref="821768455"/> + <reference key="destination" ref="1022040155"/> + </object> + <int key="connectionID">625</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">object4_</string> + <reference key="source" ref="821768455"/> + <reference key="destination" ref="90260648"/> + </object> + <int key="connectionID">626</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">syncLink_</string> + <reference key="source" ref="1001"/> + <reference key="destination" ref="1022040155"/> + </object> + <int key="connectionID">627</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -4087,8 +4135,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference ref="865039969"/> <reference ref="987908490"/> <reference ref="20640598"/> - <reference ref="90260648"/> <reference ref="203729106"/> + <reference ref="1022040155"/> + <reference ref="90260648"/> </object> <reference key="parent" ref="196155028"/> <string key="objectName">Personal Stuff View</string> @@ -4838,6 +4887,20 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <reference key="parent" ref="196155028"/> <string key="objectName">Personal Stuff Sync Group</string> </object> + <object class="IBObjectRecord"> + <int key="objectID">622</int> + <reference key="object" ref="1022040155"/> + <object class="NSMutableArray" key="children"> + <bool key="EncodedWithXMLCoder">YES</bool> + <reference ref="1047338722"/> + </object> + <reference key="parent" ref="393583039"/> + </object> + <object class="IBObjectRecord"> + <int key="objectID">623</int> + <reference key="object" ref="1047338722"/> + <reference key="parent" ref="1022040155"/> + </object> </object> </object> <object class="NSMutableDictionary" key="flattenedProperties"> @@ -4998,6 +5061,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>61.IBPluginDependency</string> <string>610.IBPluginDependency</string> <string>62.IBPluginDependency</string> + <string>622.IBPluginDependency</string> + <string>623.CustomClassName</string> + <string>623.IBPluginDependency</string> <string>63.IBPluginDependency</string> <string>64.IBPluginDependency</string> <string>65.IBPluginDependency</string> @@ -5134,7 +5200,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <object class="NSMutableArray"> <bool key="EncodedWithXMLCoder">YES</bool> </object> - <string>{{181, 428}, {530, 370}}</string> + <string>{{181, 403}, {530, 395}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>{{87, 136}, {530, 463}}</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> @@ -5184,6 +5250,9 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> + <string>HyperlinkButtonCell</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> @@ -5231,7 +5300,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> </object> </object> <nil key="sourceID"/> - <int key="maxID">621</int> + <int key="maxID">627</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -5385,6 +5454,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>changeFontAndLanguageSettings:</string> <string>clearData:</string> <string>doSyncAction:</string> + <string>doSyncReauthentication:</string> <string>importData:</string> <string>makeDefaultBrowser:</string> <string>manageSearchEngines:</string> @@ -5419,6 +5489,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>id</string> <string>id</string> <string>id</string> + <string>id</string> </object> </object> <object class="NSMutableDictionary" key="outlets"> @@ -5442,6 +5513,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>personalStuffGroupThemes_</string> <string>personalStuffView_</string> <string>syncButton_</string> + <string>syncLink_</string> <string>syncStatus_</string> <string>toolbar_</string> <string>underTheHoodContentView_</string> @@ -5467,6 +5539,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes> <string>NSArray</string> <string>NSView</string> <string>NSButton</string> + <string>NSButton</string> <string>NSTextField</string> <string>NSToolbar</string> <string>NSView</string> diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h index 61170ce..a35a544 100644 --- a/chrome/browser/cocoa/preferences_window_controller.h +++ b/chrome/browser/cocoa/preferences_window_controller.h @@ -83,6 +83,7 @@ class ProfileSyncService; BooleanPrefMember formAutofill_; IBOutlet NSButton* syncButton_; IBOutlet NSTextField* syncStatus_; + IBOutlet NSButton* syncLink_; // Under the hood panel IBOutlet NSView* underTheHoodContentView_; @@ -127,6 +128,7 @@ class ProfileSyncService; - (IBAction)resetThemeToDefault:(id)sender; - (IBAction)themesGallery:(id)sender; - (IBAction)doSyncAction:(id)sender; +- (IBAction)doSyncReauthentication:(id)sender; // Under the hood - (IBAction)showCookies:(id)sender; diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm index 9b9bff6..e99117f 100644 --- a/chrome/browser/cocoa/preferences_window_controller.mm +++ b/chrome/browser/cocoa/preferences_window_controller.mm @@ -596,10 +596,15 @@ class PrefObserverBridge : public NotificationObserver, verticalShift += AutoSizeGroup(personalStuffGroupPasswords_, kAutoSizeGroupBehaviorVerticalToFit, verticalShift); - // We want to autosize the sync button but not the text field, so we use - // VerticalFirstToFit. + // TODO(akalin): Here we rely on the initial contents of the sync + // group's text field/link field to be large enough to hold all + // possible messages so that we don't have to re-layout when sync + // state changes. This isn't perfect, since e.g. some sync messages + // use the user's e-mail address (which may be really long), and the + // link field is usually not shown (leaving a big empty space). + // Rethink sync preferences UI for Mac. verticalShift += AutoSizeGroup(personalStuffGroupSync_, - kAutoSizeGroupBehaviorVerticalFirstToFit, + kAutoSizeGroupBehaviorVerticalToFit, verticalShift); [GTMUILocalizerAndLayoutTweaker resizeViewWithoutAutoResizingSubViews:personalStuffView_ @@ -1225,6 +1230,11 @@ const int kDisabledIndex = 1; } } +- (IBAction)doSyncReauthentication:(id)sender { + DCHECK(syncService_); + syncService_->ShowLoginDialog(); +} + - (void)setPasswordManagerEnabledIndex:(NSInteger)value { if (value == kEnabledIndex) [self recordUserAction:"Options_PasswordManager_Enable"]; @@ -1531,10 +1541,7 @@ const int kDisabledIndex = 1; // // TODO(akalin): Decomp this out since a lot of it is copied from the // Windows version. -// TODO(akalin): Actually have a control for the link. // TODO(akalin): Change the background of the status label/link on error. -// TODO(akalin): Make sure selecting the "Sync my bookmarks..." menu item -// pops up this preference pane if syncing has already been set up. - (void)syncStateChanged { DCHECK(syncService_); @@ -1555,6 +1562,8 @@ const int kDisabledIndex = 1; string16 statusLabel, linkLabel; sync_ui_util::GetStatusLabels(syncService_, &statusLabel, &linkLabel); [syncStatus_ setStringValue:base::SysUTF16ToNSString(statusLabel)]; + [syncLink_ setHidden:linkLabel.empty()]; + [syncLink_ setTitle:base::SysUTF16ToNSString(linkLabel)]; } // Show the preferences window. |