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

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: Fix review issues. 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
« no previous file with comments | « chrome/browser/ui/cocoa/web_intent_picker_cocoa.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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->model();
462 intentButtons_.reset([[NSMutableArray alloc] init]); 464 intentButtons_.reset([[NSMutableArray alloc] init]);
463 [self performLayoutWithModel:NULL]; 465 [self performLayoutWithModel:model_];
464 [[self window] makeFirstResponder:self]; 466 [[self window] makeFirstResponder:self];
465 } 467 }
466 return self; 468 return self;
467 } 469 }
468 470
469 // Handle default OSX dialog cancel mechanisms. (Cmd-.) 471 // Handle default OSX dialog cancel mechanisms. (Cmd-.)
470 - (void)cancelOperation:(id)sender { 472 - (void)cancelOperation:(id)sender {
471 if (picker_) 473 if (picker_)
472 picker_->OnCancelled(); 474 picker_->OnCancelled();
473 [self closeSheet]; 475 [self closeSheet];
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 - (void)stopThrobber { 743 - (void)stopThrobber {
742 [closeButton_ setEnabled:YES]; 744 [closeButton_ setEnabled:YES];
743 [self setIntentButtonsEnabled:YES]; 745 [self setIntentButtonsEnabled:YES];
744 [suggestionView_ stopThrobber]; 746 [suggestionView_ stopThrobber];
745 } 747 }
746 748
747 - (void)closeSheet { 749 - (void)closeSheet {
748 [NSApp endSheet:[self window]]; 750 [NSApp endSheet:[self window]];
749 } 751 }
750 @end // WebIntentPickerSheetController 752 @end // WebIntentPickerSheetController
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/web_intent_picker_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698