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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 10870094: Constrained window sheet controller (test patch) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 years, 3 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 #include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h"
6 6
7 #include "base/mac/mac_util.h" 7 #include "base/mac/mac_util.h"
8 #include "base/sys_string_conversions.h" 8 #include "base/sys_string_conversions.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/cocoa/browser_window_utils.h" 10 #include "chrome/browser/ui/cocoa/browser_window_utils.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 - (void)windowDidResignKey:(NSNotification*)notification { 48 - (void)windowDidResignKey:(NSNotification*)notification {
49 if (shellWindow_) 49 if (shellWindow_)
50 shellWindow_->WindowDidResignKey(); 50 shellWindow_->WindowDidResignKey();
51 } 51 }
52 52
53 - (void)gtm_systemRequestsVisibilityForView:(NSView*)view { 53 - (void)gtm_systemRequestsVisibilityForView:(NSView*)view {
54 [[self window] makeKeyAndOrderFront:self]; 54 [[self window] makeKeyAndOrderFront:self];
55 } 55 }
56 56
57 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window { 57 - (GTMWindowSheetController*)sheetController {
58 if (!sheetController_.get()) { 58 if (!sheetController_.get()) {
59 sheetController_.reset([[GTMWindowSheetController alloc] 59 sheetController_.reset([[GTMWindowSheetController alloc]
60 initWithWindow:[self window] 60 initWithWindow:[self window]
61 delegate:self]); 61 delegate:self]);
62 } 62 }
63 63 return sheetController_;
64 NSView* tabContentsView =
65 [window->owner()->web_contents()->GetNativeView() superview];
66 window->delegate()->RunSheet(sheetController_, tabContentsView);
67 }
68
69 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window {
70 }
71
72 - (BOOL)canAttachConstrainedWindow {
73 return YES;
74 } 64 }
75 65
76 - (void)executeCommand:(int)command { 66 - (void)executeCommand:(int)command {
77 // No-op, swallow the event. 67 // No-op, swallow the event.
78 } 68 }
79 69
80 @end 70 @end
81 71
82 @interface ShellNSWindow : ChromeEventProcessingWindow 72 @interface ShellNSWindow : ChromeEventProcessingWindow
83 73
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 NSWindow* window = [window_controller_ window]; 449 NSWindow* window = [window_controller_ window];
460 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); 450 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]);
461 return static_cast<ShellNSWindow*>(window); 451 return static_cast<ShellNSWindow*>(window);
462 } 452 }
463 453
464 // static 454 // static
465 NativeShellWindow* NativeShellWindow::Create( 455 NativeShellWindow* NativeShellWindow::Create(
466 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { 456 ShellWindow* shell_window, const ShellWindow::CreateParams& params) {
467 return new ShellWindowCocoa(shell_window, params); 457 return new ShellWindowCocoa(shell_window, params);
468 } 458 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/constrained_window_mac.mm ('k') | chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698