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

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: comment 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
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 3958dce10d4782421e74191fd37c0cb0f408b612..a80da50067467ad8511734e09907fc84c34508f3 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"
jeremya 2012/08/05 22:32:47 I don't think you need this include.
#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 {
jeremya 2012/08/05 22:32:47 Is this NOTREACHED()?
+}
+
+- (BOOL)canAttachConstrainedWindow {
+ return YES;
+}
+
@end
@interface ShellNSWindow : UnderlayOpenGLHostingWindow

Powered by Google App Engine
This is Rietveld 408576698