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

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: Fix broken include path. Created 7 years, 7 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 4096730b374dcf90bfa29406a004c46eacd7a0c1..5bd8b2d6bbfca6b9a9bd1b068990e7b6a128d77c 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 {
@@ -112,33 +114,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);
+ [[mainContainer_ view] setFrame:clientRect];
+ [[signInContainer_ view] setFrame:clientRect];
[[[self window] contentView] setSubviews:
@[[mainContainer_ view], [signInContainer_ view]]];
+
+ NSRect contentRect = clientRect;
+ contentRect.origin = NSMakePoint(0, 0);
+ contentRect.size.width += 2 * chrome_style::kHorizontalPadding;
+ contentRect.size.height += chrome_style::kClientBottomPadding +
+ chrome_style::kTitleTopPadding;
+ [[[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