summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 04:38:57 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 04:38:57 +0000
commit6e8c06595173e67890421b44c2440ca2c772553b (patch)
tree2c706e26782727df67bbc87d0591244126772ea3 /content/shell
parente18217a971a5edade02107717872891adbe4e941 (diff)
downloadchromium_src-6e8c06595173e67890421b44c2440ca2c772553b.zip
chromium_src-6e8c06595173e67890421b44c2440ca2c772553b.tar.gz
chromium_src-6e8c06595173e67890421b44c2440ca2c772553b.tar.bz2
This CL adds pepper flash fullscreen support on Mac.
Pepper has two fullscreen APIs: src/ppapi/cpp/fullscreen.h pp::FullScreen::SetFullscreen() src/ppapi/cpp/private/flash_fullscreen.h pp::FlashFullScreen::SetFullscreen() The first fullscreen API simply causes the browser window to enter fullscreen as normal. This means that the menu bar and tab strip is auto-shown when the mouse is moved to the top of the screen. This feature is already working on the Mac and this CL doesn't change anything with respect to that API. The second fullscreen API creates a new web content that is hosted in its own window. To keep the architecture similar to the Windows and Linux implementation I decided not to host the web content inside a browser window. Instead I'm using a custom borderless window that's similar to windows that NPAPI plugins use today. The chrome browser fullscreen window has three interesting functionality: 1. allow OpenGL surface under the window to be visible to the user 2. Setup the background color for the tab strip / toolbar drawing 3. Auto-show the menu bar / tab strip when the mouse is at the top of the screen Of these the flash fullscreen window only needs the first. For this reason I factored out that functionality into a new common base class, UnderlayOpenGLHostingWindow. BUG= TEST=call pp::FlashFullscreen::SetFullscreen(true). Verify that the plugin goes fullscreen. Review URL: http://codereview.chromium.org/9838071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130311 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/shell_mac.mm52
1 files changed, 9 insertions, 43 deletions
diff --git a/content/shell/shell_mac.mm b/content/shell/shell_mac.mm
index 6e55a9e..b01bd4d0 100644
--- a/content/shell/shell_mac.mm
+++ b/content/shell/shell_mac.mm
@@ -11,46 +11,12 @@
#import "base/memory/scoped_nsobject.h"
#include "base/string_piece.h"
#include "base/sys_string_conversions.h"
-#import "content/public/browser/accelerated_window_interface.h"
#include "content/public/browser/native_web_keyboard_event.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/shell/resource.h"
#include "googleurl/src/gurl.h"
-
-@interface ShellWindow : NSWindow<UnderlayableSurface> {
- @private
- int underlaySurfaceCount_;
-}
-
-// Informs the window that an underlay surface has been added/removed. The
-// window is non-opaque while underlay surfaces are present.
-- (void)underlaySurfaceAdded;
-- (void)underlaySurfaceRemoved;
-
-@end
-
-@implementation ShellWindow
-
-- (void)underlaySurfaceAdded {
- DCHECK_GE(underlaySurfaceCount_, 0);
- ++underlaySurfaceCount_;
-
- // We're having the OpenGL surface render under the window, so the window
- // needs to be not opaque.
- if (underlaySurfaceCount_ == 1)
- [self setOpaque:NO];
-}
-
-- (void)underlaySurfaceRemoved {
- --underlaySurfaceCount_;
- DCHECK_GE(underlaySurfaceCount_, 0);
-
- if (underlaySurfaceCount_ == 0)
- [self setOpaque:YES];
-}
-
-@end
+#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
// Receives notification that the window is closing so that it can start the
// tear-down process. Is responsible for deleting itself when done.
@@ -177,14 +143,14 @@ void Shell::PlatformSetIsLoading(bool loading) {
void Shell::PlatformCreateWindow(int width, int height) {
NSRect initial_window_bounds = NSMakeRect(0, 0, width, height);
- window_ =
- [[ShellWindow alloc] initWithContentRect:initial_window_bounds
- styleMask:(NSTitledWindowMask |
- NSClosableWindowMask |
- NSMiniaturizableWindowMask |
- NSResizableWindowMask )
- backing:NSBackingStoreBuffered
- defer:NO];
+ window_ = [[UnderlayOpenGLHostingWindow alloc]
+ initWithContentRect:initial_window_bounds
+ styleMask:(NSTitledWindowMask |
+ NSClosableWindowMask |
+ NSMiniaturizableWindowMask |
+ NSResizableWindowMask )
+ backing:NSBackingStoreBuffered
+ defer:NO];
[window_ setTitle:kWindowTitle];
NSView* content = [window_ contentView];