Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7100)

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm

Issue 14704004: [Autofill] Add Details Section (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
index 937c6bd427d548566aa6aabe71d6f90a059de839..e5019e041504503080f957478aa28b0bd34121d9 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.mm
@@ -4,16 +4,18 @@
#include "chrome/browser/ui/cocoa/autofill/autofill_dialog_cocoa.h"
-#include "chrome/browser/ui/chrome_style.h"
#include "base/mac/bundle_locations.h"
#include "base/memory/scoped_nsobject.h"
+#include "chrome/browser/ui/chrome_style.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_button.h"
#include "chrome/browser/ui/chrome_style.h"
#include "chrome/browser/ui/chrome_style.h"
+#import "chrome/browser/ui/cocoa/autofill/autofill_details_container.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_main_container.h"
#import "chrome/browser/ui/cocoa/autofill/autofill_sign_in_container.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_sheet.h"
#import "chrome/browser/ui/cocoa/constrained_window/constrained_window_custom_window.h"
+#include "ui/base/cocoa/window_size_constants.h"
namespace autofill {
@@ -109,33 +111,39 @@ void AutofillDialogCocoa::PerformClose() {
autofillDialog:(autofill::AutofillDialogCocoa*)autofillDialog {
DCHECK(webContents);
- // TODO(groby): Should be ui::kWindowSizeDeterminedLater
- NSRect frame = NSMakeRect(0, 0, 550, 600);
scoped_nsobject<ConstrainedWindowCustomWindow> window(
- [[ConstrainedWindowCustomWindow alloc] initWithContentRect:frame]);
+ [[ConstrainedWindowCustomWindow alloc]
+ initWithContentRect:ui::kWindowSizeDeterminedLater]);
if ((self = [super initWithWindow:window])) {
webContents_ = webContents;
autofillDialog_ = autofillDialog;
- NSRect clientFrame = NSInsetRect(
- frame, chrome_style::kHorizontalPadding, 0);
- clientFrame.size.height -= chrome_style::kTitleTopPadding +
- chrome_style::kClientBottomPadding;
- clientFrame.origin.y = chrome_style::kClientBottomPadding;
mainContainer_.reset([[AutofillMainContainer alloc]
initWithController:autofillDialog->controller()]);
[mainContainer_ setTarget:self];
- [[mainContainer_ view] setFrame:clientFrame];
signInContainer_.reset(
[[AutofillSignInContainer alloc]
initWithController:autofillDialog->controller()]);
[[signInContainer_ view] setHidden:YES];
- [[signInContainer_ view] setFrame:clientFrame];
+
+ NSRect clientRect = [[mainContainer_ view] frame];
+ clientRect.origin = NSMakePoint(chrome_style::kClientBottomPadding,
+ chrome_style::kHorizontalPadding);
+ NSRect contentRect = clientRect;
sail 2013/05/01 17:12:36 move this closer to where it's used?
groby-ooo-7-16 2013/05/01 20:37:44 Done.
+ contentRect.origin = NSMakePoint(0, 0);
+ contentRect.size.width += 2 * chrome_style::kHorizontalPadding;
+ contentRect.size.height += chrome_style::kClientBottomPadding +
+ chrome_style::kTitleTopPadding;
+ [[mainContainer_ view] setFrame:clientRect];
+ [[signInContainer_ view] setFrame:clientRect];
[[[self window] contentView] setSubviews:
@[[mainContainer_ view], [signInContainer_ view]]];
+ [[[self window] contentView] setFrame:contentRect];
+ NSRect frame = [[self window] frameRectForContentRect:contentRect];
+ [[self window] setFrame:frame display:YES];
}
return self;
}

Powered by Google App Engine
This is Rietveld 408576698