| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "chrome/browser/ui/browser_dialogs.h" | 10 #import "chrome/browser/ui/browser_dialogs.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 gfx::Size dialogSize; | 312 gfx::Size dialogSize; |
| 313 delegate->GetDialogSize(&dialogSize); | 313 delegate->GetDialogSize(&dialogSize); |
| 314 NSRect dialogRect = NSMakeRect(0, 0, dialogSize.width(), dialogSize.height()); | 314 NSRect dialogRect = NSMakeRect(0, 0, dialogSize.width(), dialogSize.height()); |
| 315 NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | | 315 NSUInteger style = NSTitledWindowMask | NSClosableWindowMask | |
| 316 NSResizableWindowMask; | 316 NSResizableWindowMask; |
| 317 base::scoped_nsobject<ChromeEventProcessingWindow> window( | 317 base::scoped_nsobject<ChromeEventProcessingWindow> window( |
| 318 [[ChromeEventProcessingWindow alloc] | 318 [[ChromeEventProcessingWindow alloc] |
| 319 initWithContentRect:dialogRect | 319 initWithContentRect:dialogRect |
| 320 styleMask:style | 320 styleMask:style |
| 321 backing:NSBackingStoreBuffered | 321 backing:NSBackingStoreBuffered |
| 322 defer:YES]); | 322 defer:NO]); |
| 323 if (!window.get()) { | 323 if (!window.get()) { |
| 324 return nil; | 324 return nil; |
| 325 } | 325 } |
| 326 self = [super initWithWindow:window]; | 326 self = [super initWithWindow:window]; |
| 327 if (!self) { | 327 if (!self) { |
| 328 return nil; | 328 return nil; |
| 329 } | 329 } |
| 330 [window setWindowController:self]; | 330 [window setWindowController:self]; |
| 331 [window setDelegate:self]; | 331 [window setDelegate:self]; |
| 332 [window setTitle:base::SysUTF16ToNSString(delegate->GetDialogTitle())]; | 332 [window setTitle:base::SysUTF16ToNSString(delegate->GetDialogTitle())]; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 358 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender | 358 // TODO(akalin): Figure out why implementing (void)cancel:(id)sender |
| 359 // to do the above doesn't work. | 359 // to do the above doesn't work. |
| 360 } | 360 } |
| 361 | 361 |
| 362 - (void)windowWillClose:(NSNotification*)notification { | 362 - (void)windowWillClose:(NSNotification*)notification { |
| 363 delegate_->WindowControllerClosed(); | 363 delegate_->WindowControllerClosed(); |
| 364 [self autorelease]; | 364 [self autorelease]; |
| 365 } | 365 } |
| 366 | 366 |
| 367 @end | 367 @end |
| OLD | NEW |