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

Side by Side Diff: chrome/browser/ui/cocoa/web_intent_sheet_controller.mm

Issue 10413044: Use existing model for initial layout, if we can. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_intent_sheet_controller.h" 5 #import "chrome/browser/ui/cocoa/web_intent_sheet_controller.h"
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/memory/scoped_nsobject.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 // |window| is retained by the ConstrainedWindowMacDelegateCustomSheet when 452 // |window| is retained by the ConstrainedWindowMacDelegateCustomSheet when
453 // the sheet is initialized. 453 // the sheet is initialized.
454 scoped_nsobject<NSWindow> window( 454 scoped_nsobject<NSWindow> window(
455 [[NSWindow alloc] initWithContentRect:contentRect 455 [[NSWindow alloc] initWithContentRect:contentRect
456 styleMask:NSTitledWindowMask 456 styleMask:NSTitledWindowMask
457 backing:NSBackingStoreBuffered 457 backing:NSBackingStoreBuffered
458 defer:YES]); 458 defer:YES]);
459 459
460 if ((self = [super initWithWindow:window.get()])) { 460 if ((self = [super initWithWindow:window.get()])) {
461 picker_ = picker; 461 picker_ = picker;
462 if (picker)
463 model_ = picker->get_model();
464 else
465 model_ = NULL;
Robert Sesek 2012/05/22 00:19:54 Cocoa will initialize this for you to 0, so you do
groby-ooo-7-16 2012/05/22 00:32:09 Done.
462 intentButtons_.reset([[NSMutableArray alloc] init]); 466 intentButtons_.reset([[NSMutableArray alloc] init]);
463 [self performLayoutWithModel:NULL]; 467 [self performLayoutWithModel:model_];
464 [[self window] makeFirstResponder:self]; 468 [[self window] makeFirstResponder:self];
465 } 469 }
466 return self; 470 return self;
467 } 471 }
468 472
469 // Handle default OSX dialog cancel mechanisms. (Cmd-.) 473 // Handle default OSX dialog cancel mechanisms. (Cmd-.)
470 - (void)cancelOperation:(id)sender { 474 - (void)cancelOperation:(id)sender {
471 if (picker_) 475 if (picker_)
472 picker_->OnCancelled(); 476 picker_->OnCancelled();
473 [self closeSheet]; 477 [self closeSheet];
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 - (void)stopThrobber { 745 - (void)stopThrobber {
742 [closeButton_ setEnabled:YES]; 746 [closeButton_ setEnabled:YES];
743 [self setIntentButtonsEnabled:YES]; 747 [self setIntentButtonsEnabled:YES];
744 [suggestionView_ stopThrobber]; 748 [suggestionView_ stopThrobber];
745 } 749 }
746 750
747 - (void)closeSheet { 751 - (void)closeSheet {
748 [NSApp endSheet:[self window]]; 752 [NSApp endSheet:[self window]];
749 } 753 }
750 @end // WebIntentPickerSheetController 754 @end // WebIntentPickerSheetController
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698