summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/nibs/Preferences.xib206
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.h8
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm144
3 files changed, 50 insertions, 308 deletions
diff --git a/chrome/app/nibs/Preferences.xib b/chrome/app/nibs/Preferences.xib
index 3be4915..00123ef 100644
--- a/chrome/app/nibs/Preferences.xib
+++ b/chrome/app/nibs/Preferences.xib
@@ -2,15 +2,14 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">9L31a</string>
+ <string key="IBDocument.SystemVersion">9L30</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="74"/>
<integer value="3"/>
- <integer value="482"/>
- <integer value="481"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -159,7 +158,7 @@
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
</object>
<object class="NSCustomView" id="1016273328">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -516,18 +515,18 @@
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
- <object class="NSMenuItem" key="NSMenuItem" id="549082417">
+ <object class="NSMenuItem" key="NSMenuItem" id="202272761">
<reference key="NSMenu" ref="12577397"/>
- <string key="NSTitle">Allow all cookies</string>
+ <string key="NSTitle">^IDS_OPTIONS_COOKIES_BLOCK_ALL_COOKIES</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
- <object class="NSCustomResource" key="NSOnImage" id="321597719">
+ <object class="NSCustomResource" key="NSOnImage" id="212205841">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuCheckmark</string>
</object>
- <object class="NSCustomResource" key="NSMixedImage" id="900989092">
+ <object class="NSCustomResource" key="NSMixedImage" id="171904678">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSMenuMixedState</string>
</object>
@@ -539,31 +538,32 @@
<string key="NSTitle">OtherViews</string>
<object class="NSMutableArray" key="NSMenuItems">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="549082417"/>
- <object class="NSMenuItem" id="139625100">
+ <object class="NSMenuItem" id="549082417">
<reference key="NSMenu" ref="12577397"/>
- <string key="NSTitle">Accept cookies only from sites I visit</string>
+ <string key="NSTitle">^IDS_OPTIONS_COOKIES_ACCEPT_ALL_COOKIES</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="321597719"/>
- <reference key="NSMixedImage" ref="900989092"/>
+ <reference key="NSOnImage" ref="212205841"/>
+ <reference key="NSMixedImage" ref="171904678"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="583724370"/>
</object>
- <object class="NSMenuItem" id="202272761">
+ <object class="NSMenuItem" id="139625100">
<reference key="NSMenu" ref="12577397"/>
- <string key="NSTitle">Block all cookies</string>
+ <string key="NSTitle">^IDS_OPTIONS_COOKIES_RESTRICT_THIRD_PARTY_COOKIES</string>
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="321597719"/>
- <reference key="NSMixedImage" ref="900989092"/>
+ <reference key="NSOnImage" ref="212205841"/>
+ <reference key="NSMixedImage" ref="171904678"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="583724370"/>
</object>
+ <reference ref="202272761"/>
</object>
</object>
+ <int key="NSSelectedIndex">2</int>
<int key="NSPreferredEdge">1</int>
<bool key="NSUsesItemFromMenu">YES</bool>
<bool key="NSAltersState">YES</bool>
@@ -702,6 +702,7 @@
</object>
</object>
<string key="NSFrameSize">{443, 665}</string>
+ <reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSArrayController" id="495015235">
@@ -723,7 +724,7 @@
<bool key="NSSharedInstance">YES</bool>
</object>
<object class="NSCustomView" id="930668015">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1618,8 +1619,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<int key="NSState">1</int>
- <reference key="NSOnImage" ref="321597719"/>
- <reference key="NSMixedImage" ref="900989092"/>
+ <reference key="NSOnImage" ref="212205841"/>
+ <reference key="NSMixedImage" ref="171904678"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="197973245"/>
</object>
@@ -1698,11 +1699,10 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<string key="NSFrameSize">{530, 468}</string>
- <reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="393583039">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -2270,61 +2270,8 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSPeriodicInterval">25</int>
</object>
</object>
- <object class="NSButton" id="264750568">
- <reference key="NSNextResponder" ref="393583039"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{146, 293}, {184, 32}}</string>
- <reference key="NSSuperview" ref="393583039"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="166568678">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">^IDS_SYNC_START_SYNC_BUTTON_LABEL</string>
- <reference key="NSSupport" ref="445696277"/>
- <reference key="NSControlView" ref="264750568"/>
- <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 class="NSTextField" id="428858528">
- <reference key="NSNextResponder" ref="393583039"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 316}, {128, 34}}</string>
- <reference key="NSSuperview" ref="393583039"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="972650963">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">71303168</int>
- <string key="NSContents">^IDS_SYNC_OPTIONS_GROUP_NAME</string>
- <reference key="NSSupport" ref="290273273"/>
- <reference key="NSControlView" ref="428858528"/>
- <reference key="NSBackgroundColor" ref="592613688"/>
- <reference key="NSTextColor" ref="748094473"/>
- </object>
- </object>
- <object class="NSTextField" id="180162612">
- <reference key="NSNextResponder" ref="393583039"/>
- <int key="NSvFlags">266</int>
- <string key="NSFrame">{{149, 330}, {364, 17}}</string>
- <reference key="NSSuperview" ref="393583039"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="899868346">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">272629760</int>
- <string key="NSContents">^IDS_SYNC_NOT_SET_UP_INFO</string>
- <reference key="NSSupport" ref="783256529"/>
- <reference key="NSControlView" ref="180162612"/>
- <reference key="NSBackgroundColor" ref="592613688"/>
- <reference key="NSTextColor" ref="748094473"/>
- </object>
- </object>
</object>
- <string key="NSFrameSize">{530, 370}</string>
- <reference key="NSSuperview"/>
+ <string key="NSFrameSize">{530, 290}</string>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="933437956">
@@ -2352,6 +2299,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>
@@ -2382,6 +2330,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"/>
@@ -3533,38 +3482,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
<int key="connectionID">600</int>
</object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">syncButton_</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="264750568"/>
- </object>
- <int key="connectionID">618</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">syncLabel_</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="428858528"/>
- </object>
- <int key="connectionID">619</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">syncStatus_</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="180162612"/>
- </object>
- <int key="connectionID">620</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">doSyncAction:</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="264750568"/>
- </object>
- <int key="connectionID">621</int>
- </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -4028,6 +3945,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="173446497"/>
<reference ref="1019357609"/>
+ <reference ref="667220499"/>
<reference ref="212252045"/>
<reference ref="155299174"/>
<reference ref="885386403"/>
@@ -4037,10 +3955,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference ref="423027085"/>
<reference ref="865039969"/>
<reference ref="987908490"/>
- <reference ref="667220499"/>
- <reference ref="264750568"/>
- <reference ref="428858528"/>
- <reference ref="180162612"/>
</object>
<reference key="parent" ref="415821041"/>
<string key="objectName">Personal Stuff View</string>
@@ -4742,48 +4656,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<reference key="object" ref="938815385"/>
<reference key="parent" ref="415821041"/>
</object>
- <object class="IBObjectRecord">
- <int key="objectID">612</int>
- <reference key="object" ref="264750568"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="166568678"/>
- </object>
- <reference key="parent" ref="393583039"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">613</int>
- <reference key="object" ref="428858528"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="972650963"/>
- </object>
- <reference key="parent" ref="393583039"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">614</int>
- <reference key="object" ref="180162612"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="899868346"/>
- </object>
- <reference key="parent" ref="393583039"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">615</int>
- <reference key="object" ref="899868346"/>
- <reference key="parent" ref="180162612"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">616</int>
- <reference key="object" ref="972650963"/>
- <reference key="parent" ref="428858528"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">617</int>
- <reference key="object" ref="166568678"/>
- <reference key="parent" ref="264750568"/>
- </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -4936,12 +4808,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>596.IBPluginDependency</string>
<string>60.IBPluginDependency</string>
<string>61.IBPluginDependency</string>
- <string>612.IBPluginDependency</string>
- <string>613.IBPluginDependency</string>
- <string>614.IBPluginDependency</string>
- <string>615.IBPluginDependency</string>
- <string>616.IBPluginDependency</string>
- <string>617.IBPluginDependency</string>
<string>62.IBPluginDependency</string>
<string>63.IBPluginDependency</string>
<string>64.IBPluginDependency</string>
@@ -5001,7 +4867,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{587, 561}, {318, 63}}</string>
+ <string>{{587, 561}, {473, 63}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5079,7 +4945,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<object class="NSMutableArray">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
- <string>{{936, 541}, {530, 370}}</string>
+ <string>{{86, 695}, {530, 290}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{87, 136}, {530, 463}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5129,12 +4995,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<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>{{557, 200}, {443, 665}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -5175,7 +5035,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">621</int>
+ <int key="maxID">600</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -5327,7 +5187,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>addHomepage:</string>
<string>browseDownloadLocation:</string>
<string>clearData:</string>
- <string>doSyncAction:</string>
<string>importData:</string>
<string>makeDefaultBrowser:</string>
<string>manageSearchEngines:</string>
@@ -5356,7 +5215,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>id</string>
<string>id</string>
<string>id</string>
- <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -5378,9 +5236,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>personalStuffGroupPasswords_</string>
<string>personalStuffGroupThemes_</string>
<string>personalStuffView_</string>
- <string>syncButton_</string>
- <string>syncLabel_</string>
- <string>syncStatus_</string>
<string>toolbar_</string>
<string>underTheHoodContentView_</string>
<string>underTheHoodScroller_</string>
@@ -5403,9 +5258,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<string>NSArray</string>
<string>NSArray</string>
<string>NSView</string>
- <string>NSButton</string>
- <string>NSTextField</string>
- <string>NSTextField</string>
<string>NSToolbar</string>
<string>NSView</string>
<string>NSScrollView</string>
diff --git a/chrome/browser/cocoa/preferences_window_controller.h b/chrome/browser/cocoa/preferences_window_controller.h
index c66665b..8f6351d 100644
--- a/chrome/browser/cocoa/preferences_window_controller.h
+++ b/chrome/browser/cocoa/preferences_window_controller.h
@@ -12,7 +12,6 @@
class PrefObserverBridge;
class PrefService;
class Profile;
-class ProfileSyncService;
@class SearchEngineListModel;
// A window controller that handles the preferences window. The bulk of the
@@ -31,8 +30,6 @@ class ProfileSyncService;
@private
Profile* profile_; // weak ref
PrefService* prefs_; // weak ref - Obtained from profile_ for convenience.
- // weak ref - Also obtained from profile_ for convenience. May be NULL.
- ProfileSyncService* sync_service_;
scoped_ptr<PrefObserverBridge> observer_; // Watches for pref changes.
IBOutlet NSToolbar* toolbar_;
@@ -52,7 +49,6 @@ class ProfileSyncService;
IBOutlet NSArray* basicsGroupDefaultBrowser_;
// The groups of the Personal Stuff view for layout fixup.
- IBOutlet NSArray* personalStuffGroupSync_;
IBOutlet NSArray* personalStuffGroupPasswords_;
IBOutlet NSArray* personalStuffGroupAutofill_;
IBOutlet NSArray* personalStuffGroupBrowserData_;
@@ -77,9 +73,6 @@ class ProfileSyncService;
// User Data panel
BooleanPrefMember askSavePasswords_;
BooleanPrefMember formAutofill_;
- IBOutlet NSTextField* syncLabel_;
- IBOutlet NSTextField* syncStatus_;
- IBOutlet NSButton* syncButton_;
// Under the hood panel
IBOutlet NSView* underTheHoodContentView_;
@@ -119,7 +112,6 @@ class ProfileSyncService;
- (IBAction)clearData:(id)sender;
- (IBAction)resetThemeToDefault:(id)sender;
- (IBAction)themesGallery:(id)sender;
-- (IBAction)doSyncAction:(id)sender;
// Under the hood
- (IBAction)browseDownloadLocation:(id)sender;
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index 08f2437..bdb4dd6 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -7,7 +7,6 @@
#include <algorithm>
#include "app/l10n_util.h"
#include "base/mac_util.h"
-#include "base/string16.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/browser.h"
@@ -27,8 +26,6 @@
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/session_startup_pref.h"
#include "chrome/browser/shell_integration.h"
-#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/sync_status_ui_helper.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/notification_details.h"
#include "chrome/common/notification_observer.h"
@@ -252,6 +249,7 @@ NSInteger CompareFrameY(id view1, id view2, void* context) {
return NSOrderedSame;
}
+#if !defined(GOOGLE_CHROME_BUILD)
// Helper to remove a view and move everything above it down to take over the
// space.
void RemoveViewFromView(NSView* view, NSView* toRemove) {
@@ -263,27 +261,21 @@ void RemoveViewFromView(NSView* view, NSView* toRemove) {
NSUInteger index = [views indexOfObject:toRemove];
DCHECK_NE(index, NSNotFound);
NSUInteger count = [views count];
- CGFloat shrinkHeight = 0;
- if (index < (count - 1)) {
- // The amount to shift is the bottom of |toRemove| to the bottom of the view
- // above it.
- CGFloat shiftDown =
- NSMinY([[views objectAtIndex:index + 1] frame]) -
- NSMinY([toRemove frame]);
-
- // Now cycle over the views above it moving them down.
- for (++index; index < count; ++index) {
- NSView* view = [views objectAtIndex:index];
- NSPoint origin = [view frame].origin;
- origin.y -= shiftDown;
- [view setFrameOrigin:origin];
- }
-
- shrinkHeight = shiftDown;
- } else if (index > 0) {
- shrinkHeight =
- NSMaxY([toRemove frame]) -
- NSMaxY([[views objectAtIndex:index - 1] frame]);
+ if (index == (count - 1))
+ return; // It was the top item, nothing to do (shouldn't happen).
+
+ // The amount to shift is the bottom of |toRemove| to the bottom of the view
+ // above it.
+ CGFloat shiftDown =
+ NSMinY([[views objectAtIndex:index + 1] frame]) -
+ NSMinY([toRemove frame]);
+
+ // Now cycle over the views above it moving them down.
+ for (++index; index < count; ++index) {
+ NSView* view = [views objectAtIndex:index];
+ NSPoint origin = [view frame].origin;
+ origin.y -= shiftDown;
+ [view setFrameOrigin:origin];
}
// Remove |toRemove|.
@@ -292,14 +284,9 @@ void RemoveViewFromView(NSView* view, NSView* toRemove) {
// Resize the view.
[GTMUILocalizerAndLayoutTweaker
resizeViewWithoutAutoResizingSubViews:view
- delta:NSMakeSize(0, -shrinkHeight)];
-}
-
-void RemoveGroupFromView(NSView* view, NSArray* toRemove) {
- for (NSView* viewToRemove in toRemove) {
- RemoveViewFromView(view, viewToRemove);
- }
+ delta:NSMakeSize(0, -shiftDown)];
}
+#endif // !defined(GOOGLE_CHROME_BUILD)
// Helper to tweak the layout of the "Under the Hood" content by autosizing all
// the views and moving things up vertically. Special case the two controls for
@@ -345,9 +332,6 @@ CGFloat AutoSizeUnderTheHoodContent(NSView* view,
// Callback when preferences are changed. |prefName| is the name of the
// pref that has changed.
- (void)prefChanged:(std::wstring*)prefName;
-// Callback when sync state has changed. sync_service_ needs to be
-// queries to find out what happened.
-- (void)syncStateChanged;
// Record the user performed a certain action and save the preferences.
- (void)recordUserAction:(const wchar_t*)action;
- (void)registerPrefObservers;
@@ -377,14 +361,10 @@ CGFloat AutoSizeUnderTheHoodContent(NSView* view,
// A C++ class registered for changes in preferences. Bridges the
// notification back to the PWC.
-class PrefObserverBridge : public NotificationObserver,
- public ProfileSyncServiceObserver {
+class PrefObserverBridge : public NotificationObserver {
public:
PrefObserverBridge(PreferencesWindowController* controller)
- : controller_(controller) {}
-
- virtual ~PrefObserverBridge() {}
-
+ : controller_(controller) { }
// Overridden from NotificationObserver:
virtual void Observe(NotificationType type,
const NotificationSource& source,
@@ -392,12 +372,6 @@ class PrefObserverBridge : public NotificationObserver,
if (type == NotificationType::PREF_CHANGED)
[controller_ prefChanged:Details<std::wstring>(details).ptr()];
}
-
- // Overridden from ProfileSyncServiceObserver.
- virtual void OnStateChanged() {
- [controller_ syncStateChanged];
- }
-
private:
PreferencesWindowController* controller_; // weak, owns us
};
@@ -460,9 +434,6 @@ class PrefObserverBridge : public NotificationObserver,
// it up a bit.
[animation_ gtm_setDuration:0.2];
[animation_ setAnimationBlockingMode:NSAnimationNonblocking];
-
- // TODO(akalin): handle incognito profiles?
- sync_service_ = profile_->GetProfileSyncService();
}
return self;
}
@@ -493,7 +464,7 @@ class PrefObserverBridge : public NotificationObserver,
#endif // !defined(GOOGLE_CHROME_BUILD)
// There are three problem children within the groups:
- // Basics - Default Browser
+ // Bascis - Default Browser
// Personal Stuff - Themes
// Personal Stuff - Browser Data
// These three have buttons that with some localizations are wider then the
@@ -576,9 +547,6 @@ class PrefObserverBridge : public NotificationObserver,
delta:NSMakeSize(0.0, verticalShift)];
verticalShift = 0.0;
- verticalShift += AutoSizeGroup(personalStuffGroupSync_,
- kAutoSizeGroupBehaviorVerticalToFit,
- verticalShift);
verticalShift += AutoSizeGroup(personalStuffGroupThemes_,
kAutoSizeGroupBehaviorHorizontalToFit,
verticalShift);
@@ -595,14 +563,6 @@ class PrefObserverBridge : public NotificationObserver,
resizeViewWithoutAutoResizingSubViews:personalStuffView_
delta:NSMakeSize(0.0, verticalShift)];
- if (sync_service_) {
- sync_service_->AddObserver(observer_.get());
- [self syncStateChanged];
- } else {
- // Disable controls if sync is disabled.
- RemoveGroupFromView(personalStuffView_, personalStuffGroupSync_);
- }
-
// Make the window as wide as the views.
NSWindow* prefsWindow = [self window];
NSRect frame = [prefsWindow frame];
@@ -653,9 +613,6 @@ class PrefObserverBridge : public NotificationObserver,
}
- (void)dealloc {
- if (sync_service_) {
- sync_service_->RemoveObserver(observer_.get());
- }
[customPagesSource_ removeObserver:self forKeyPath:@"customHomePages"];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self unregisterPrefObservers];
@@ -1176,31 +1133,6 @@ const int kDisabledIndex = 1;
}
}
-- (IBAction)doSyncAction:(id)sender {
- DCHECK(sync_service_);
-
- if (sync_service_->HasSyncSetupCompleted()) {
- sync_service_->DisableForUser();
- ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);
- /*
- ConfirmMessageBoxDialog::RunWithCustomConfiguration(
- GetWindow()->GetNativeWindow(),
- this,
- l10n_util::GetString(IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL),
- l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL),
- l10n_util::GetString(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL),
- l10n_util::GetString(IDS_CANCEL),
- gfx::Size(views::Window::GetLocalizedContentsSize(
- IDS_CONFIRM_STOP_SYNCING_DIALOG_WIDTH_CHARS,
- IDS_CONFIRM_STOP_SYNCING_DIALOG_HEIGHT_LINES)));
- return;
- */
- } else {
- sync_service_->EnableForUser();
- ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
- }
-}
-
- (void)setPasswordManagerEnabledIndex:(NSInteger)value {
if (value == kEnabledIndex)
[self recordUserAction:L"Options_PasswordManager_Enable"];
@@ -1594,40 +1526,6 @@ const int kDisabledIndex = 1;
[self underHoodPrefChanged:prefName];
}
-// Callback when sync service state has changed.
-// TODO(akalin): Decomp this out since a lot of it is copied from the
-// Windows version.
-- (void)syncStateChanged {
- DCHECK(sync_service_);
- string16 status_label;
- string16 link_label;
- std::wstring button_label;
- bool sync_setup_completed = sync_service_->HasSyncSetupCompleted();
- bool status_has_error =
- SyncStatusUIHelper::GetLabels(sync_service_, &status_label, &link_label)
- == SyncStatusUIHelper::SYNC_ERROR;
- if (sync_setup_completed) {
- button_label = l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL);
- } else if (sync_service_->SetupInProgress()) {
- button_label = l10n_util::GetString(IDS_SYNC_NTP_SETUP_IN_PROGRESS);
- } else {
- button_label = l10n_util::GetString(IDS_SYNC_START_SYNC_BUTTON_LABEL);
- }
-
- [syncStatus_ setStringValue:base::SysUTF16ToNSString(status_label)];
- [syncButton_ setEnabled:!sync_service_->WizardIsVisible()];
- [syncButton_ setTitle:base::SysWideToNSString(button_label)];
- // sync_action_link_->SetText(link_label);
- // sync_action_link_->SetVisible(!link_label.empty());
- if (status_has_error) {
- // sync_status_label_->set_background(CreateErrorBackground());
- // sync_action_link_->set_background(CreateErrorBackground());
- } else {
- // sync_status_label_->set_background(NULL);
- // sync_action_link_->set_background(NULL);
- }
-}
-
// Show the preferences window.
- (IBAction)showPreferences:(id)sender {
[self showWindow:sender];