| 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 #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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 - (void)windowDidMove:(NSNotification*)notification { | 58 - (void)windowDidMove:(NSNotification*)notification { |
| 59 if (shellWindow_) | 59 if (shellWindow_) |
| 60 shellWindow_->WindowDidMove(); | 60 shellWindow_->WindowDidMove(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 - (void)gtm_systemRequestsVisibilityForView:(NSView*)view { | 63 - (void)gtm_systemRequestsVisibilityForView:(NSView*)view { |
| 64 [[self window] makeKeyAndOrderFront:self]; | 64 [[self window] makeKeyAndOrderFront:self]; |
| 65 } | 65 } |
| 66 | 66 |
| 67 - (void)attachConstrainedWindow:(ConstrainedWindowMac*)window { | 67 - (GTMWindowSheetController*)sheetController { |
| 68 if (!sheetController_.get()) { | 68 if (!sheetController_.get()) { |
| 69 sheetController_.reset([[GTMWindowSheetController alloc] | 69 sheetController_.reset([[GTMWindowSheetController alloc] |
| 70 initWithWindow:[self window] | 70 initWithWindow:[self window] |
| 71 delegate:self]); | 71 delegate:self]); |
| 72 } | 72 } |
| 73 | 73 return sheetController_; |
| 74 NSView* tabContentsView = | |
| 75 [window->owner()->web_contents()->GetNativeView() superview]; | |
| 76 window->delegate()->RunSheet(sheetController_, tabContentsView); | |
| 77 } | |
| 78 | |
| 79 - (void)removeConstrainedWindow:(ConstrainedWindowMac*)window { | |
| 80 } | |
| 81 | |
| 82 - (BOOL)canAttachConstrainedWindow { | |
| 83 return YES; | |
| 84 } | 74 } |
| 85 | 75 |
| 86 - (void)executeCommand:(int)command { | 76 - (void)executeCommand:(int)command { |
| 87 // No-op, swallow the event. | 77 // No-op, swallow the event. |
| 88 } | 78 } |
| 89 | 79 |
| 90 @end | 80 @end |
| 91 | 81 |
| 92 @interface ShellNSWindow : ChromeEventProcessingWindow | 82 @interface ShellNSWindow : ChromeEventProcessingWindow |
| 93 | 83 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 NSWindow* window = [window_controller_ window]; | 480 NSWindow* window = [window_controller_ window]; |
| 491 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); | 481 CHECK(!window || [window isKindOfClass:[ShellNSWindow class]]); |
| 492 return static_cast<ShellNSWindow*>(window); | 482 return static_cast<ShellNSWindow*>(window); |
| 493 } | 483 } |
| 494 | 484 |
| 495 // static | 485 // static |
| 496 NativeShellWindow* NativeShellWindow::Create( | 486 NativeShellWindow* NativeShellWindow::Create( |
| 497 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 487 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
| 498 return new ShellWindowCocoa(shell_window, params); | 488 return new ShellWindowCocoa(shell_window, params); |
| 499 } | 489 } |
| OLD | NEW |