diff options
-rw-r--r-- | chrome/app/nibs/AutoFillDialog.xib | 4 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_dialog_controller_mac.h | 3 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_dialog_controller_mac.mm | 16 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.cc | 5 | ||||
-rw-r--r-- | chrome/browser/autofill/autofill_manager.h | 3 | ||||
-rw-r--r-- | chrome/browser/browser_prefs.cc | 1 | ||||
-rw-r--r-- | chrome/common/pref_names.cc | 3 | ||||
-rw-r--r-- | chrome/common/pref_names.h | 1 |
8 files changed, 32 insertions, 4 deletions
diff --git a/chrome/app/nibs/AutoFillDialog.xib b/chrome/app/nibs/AutoFillDialog.xib index e4ab911..039a4b7 100644 --- a/chrome/app/nibs/AutoFillDialog.xib +++ b/chrome/app/nibs/AutoFillDialog.xib @@ -38,8 +38,8 @@ <object class="NSWindowTemplate" id="1005"> <int key="NSWindowStyleMask">9</int> <int key="NSWindowBacking">2</int> - <string key="NSWindowRect">{{990, 893}, {570, 544}}</string> - <int key="NSWTFlags">538968064</int> + <string key="NSWindowRect">{{1022, 661}, {570, 544}}</string> + <int key="NSWTFlags">544735232</int> <string key="NSWindowTitle">^IDS_AUTOFILL_DIALOG_TITLE</string> <string key="NSWindowClass">NSWindow</string> <nil key="NSViewClass"/> diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.h b/chrome/browser/autofill/autofill_dialog_controller_mac.h index 322e4cc..2ea9c54 100644 --- a/chrome/browser/autofill/autofill_dialog_controller_mac.h +++ b/chrome/browser/autofill/autofill_dialog_controller_mac.h @@ -15,6 +15,7 @@ @class AutoFillAddressViewController; @class AutoFillCreditCardViewController; @class SectionSeparatorView; +@class WindowSizeAutosaver; // A window controller for managing the autofill options dialog. // Application modally presents a dialog allowing the user to store @@ -39,6 +40,8 @@ AutoFillDialogObserver* observer_; // Weak, not retained. std::vector<AutoFillProfile> profiles_; std::vector<CreditCard> creditCards_; + + scoped_nsobject<WindowSizeAutosaver> sizeSaver_; } // Main interface for displaying an application modal autofill dialog on screen. diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.mm b/chrome/browser/autofill/autofill_dialog_controller_mac.mm index 418f699..e5f325e 100644 --- a/chrome/browser/autofill/autofill_dialog_controller_mac.mm +++ b/chrome/browser/autofill/autofill_dialog_controller_mac.mm @@ -9,9 +9,12 @@ #import "chrome/browser/autofill/autofill_address_view_controller_mac.h" #import "chrome/browser/autofill/autofill_credit_card_model_mac.h" #import "chrome/browser/autofill/autofill_credit_card_view_controller_mac.h" +#include "chrome/browser/browser_process.h" #import "chrome/browser/cocoa/disclosure_view_controller.h" #import "chrome/browser/cocoa/section_separator_view.h" +#import "chrome/browser/cocoa/window_size_autosaver.h" #include "chrome/browser/profile.h" +#include "chrome/common/pref_names.h" #include "grit/generated_resources.h" @interface AutoFillDialogController (PrivateMethods) @@ -106,7 +109,7 @@ AutoFillAddressViewController* addressViewController = [[AutoFillAddressViewController alloc] initWithProfile:newProfile - disclosure:NSOffState + disclosure:NSOnState controller:self]; [addressFormViewControllers_.get() addObject:addressViewController]; @@ -141,7 +144,7 @@ AutoFillCreditCardViewController* creditCardViewController = [[AutoFillCreditCardViewController alloc] initWithCreditCard:newCreditCard - disclosure:NSOffState + disclosure:NSOnState controller:self]; [creditCardFormViewControllers_.get() addObject:creditCardViewController]; @@ -282,6 +285,15 @@ // Run application modal. - (void)runModalDialog { + // Use stored window geometry if it exists. + if (g_browser_process && g_browser_process->local_state()) { + sizeSaver_.reset([[WindowSizeAutosaver alloc] + initWithWindow:[self window] + prefService:g_browser_process->local_state() + path:prefs::kAutoFillDialogPlacement + state:kSaveWindowPos]); + } + [NSApp runModalForWindow:[self window]]; } diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 1ede7bf..0d005aa 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -32,6 +32,11 @@ AutoFillManager::~AutoFillManager() { } // static +void AutoFillManager::RegisterBrowserPrefs(PrefService* prefs) { + prefs->RegisterDictionaryPref(prefs::kAutoFillDialogPlacement); +} + +// static void AutoFillManager::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kAutoFillInfoBarShown, false); prefs->RegisterBooleanPref(prefs::kAutoFillEnabled, false); diff --git a/chrome/browser/autofill/autofill_manager.h b/chrome/browser/autofill/autofill_manager.h index 1517272..d629e4f 100644 --- a/chrome/browser/autofill/autofill_manager.h +++ b/chrome/browser/autofill/autofill_manager.h @@ -34,6 +34,9 @@ class AutoFillManager : public RenderViewHostDelegate::AutoFill, explicit AutoFillManager(TabContents* tab_contents); virtual ~AutoFillManager(); + // Registers our browser prefs. + static void RegisterBrowserPrefs(PrefService* prefs); + // Registers our Enable/Disable AutoFill pref. static void RegisterUserPrefs(PrefService* prefs); diff --git a/chrome/browser/browser_prefs.cc b/chrome/browser/browser_prefs.cc index 0fe7d6d..e0c45ed 100644 --- a/chrome/browser/browser_prefs.cc +++ b/chrome/browser/browser_prefs.cc @@ -83,6 +83,7 @@ void RegisterLocalState(PrefService* local_state) { CookiePromptModalDialog::RegisterPrefs(local_state); #endif geolocation::RegisterPrefs(local_state); + AutoFillManager::RegisterBrowserPrefs(local_state); } void RegisterUserPrefs(PrefService* user_prefs) { diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 733db3c..7d70df9 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -327,6 +327,9 @@ const wchar_t kAutoFillInfoBarShown[] = L"autofill.infobar_shown"; // Boolean that is true if autofill is enabled and allowed to save profile data. const wchar_t kAutoFillEnabled[] = L"autofill.enabled"; +// Position and size of the autofill dialog. +const wchar_t kAutoFillDialogPlacement[] = L"autofill.dialog_placement"; + // Dictionary that maps providers to lists of filter rules. const wchar_t kPrivacyFilterRules[] = L"profile.privacy_filter_rules"; diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index ffa5772..bcefd48 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h @@ -126,6 +126,7 @@ extern const wchar_t kClearSiteDataOnExit[]; extern const wchar_t kPerHostZoomLevels[]; extern const wchar_t kAutoFillInfoBarShown[]; extern const wchar_t kAutoFillEnabled[]; +extern const wchar_t kAutoFillDialogPlacement[]; extern const wchar_t kPrivacyFilterRules[]; extern const wchar_t kUseVerticalTabs[]; |