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

Unified Diff: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm

Issue 10823176: Cocoa: Support constrained windows for platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix print preview test Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
index 828d4adf7ad538c3e176f701ec34dcc13b3a0b94..82df758c8e236bfd724402ecc4ecda629d12c618 100644
--- a/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/shell_window_cocoa.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_utils.h"
#include "chrome/browser/ui/cocoa/extensions/extension_view_mac.h"
+#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
@@ -48,6 +49,29 @@
shellWindow_->WindowDidResignKey();
}
+- (void)gtm_systemRequestsVisibilityForView:(NSView*)view {
+ [[self window] makeKeyAndOrderFront:self];
+}
+
+- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window {
+ if (!sheetController_.get()) {
+ sheetController_.reset([[GTMWindowSheetController alloc]
+ initWithWindow:[self window]
+ delegate:self]);
+ }
+
+ NSView* tabContentsView =
+ [window->owner()->web_contents()->GetNativeView() superview];
+ window->delegate()->RunSheet(sheetController_, tabContentsView);
+}
+
+- (void)removeConstrainedWindow:(ConstrainedWindowMac*)window {
+}
+
+- (BOOL)canAttachConstrainedWindow {
+ return YES;
+}
+
@end
@interface ShellNSWindow : UnderlayOpenGLHostingWindow
« no previous file with comments | « chrome/browser/ui/cocoa/extensions/shell_window_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698