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

Unified Diff: chrome/browser/plugin_process_host_mac.cc

Issue 257008: Fix several issues around fullscreen Mac plugins:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/plugin_process_host_mac.cc
===================================================================
--- chrome/browser/plugin_process_host_mac.cc (revision 0)
+++ chrome/browser/plugin_process_host_mac.cc (revision 0)
@@ -0,0 +1,43 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <Carbon/Carbon.h>
+
+#include "build/build_config.h"
+
+#include <vector>
+
+#include "base/logging.h"
+#include "chrome/browser/plugin_process_host.h"
+
+void PluginProcessHost::OnPluginSelectWindow(uint32 window_id,
+ gfx::Rect window_rect) {
+ plugin_visible_windows_set_.insert(window_id);
+}
+
+void PluginProcessHost::OnPluginShowWindow(uint32 window_id,
+ gfx::Rect window_rect) {
+ plugin_visible_windows_set_.insert(window_id);
+ CGRect window_bounds = {
+ { window_rect.x(), window_rect.y() },
+ { window_rect.width(), window_rect.height() }
+ };
+ CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID());
+ if (CGRectEqualToRect(window_bounds, main_display_bounds)) {
+ // If the plugin has just shown a window that's the same dimensions as
+ // the main display, hide the menubar so that it has the whole screen.
+ SetSystemUIMode(kUIModeAllSuppressed, kUIOptionAutoShowMenuBar);
+ }
+}
+
+void PluginProcessHost::OnPluginHideWindow(uint32 window_id,
+ gfx::Rect window_rect) {
+ plugin_visible_windows_set_.erase(window_id);
+ SetSystemUIMode(kUIModeNormal, 0);
stuartmorgan 2009/10/01 17:17:10 I wonder if we need to track full-screen and non-f
Amanda Walker 2009/10/01 17:21:02 Ah, I'd forgotten about browser-side fullscreen mo
+}
+
+void PluginProcessHost::OnPluginDisposeWindow(uint32 window_id,
+ gfx::Rect window_rect) {
+ plugin_visible_windows_set_.erase(window_id);
+}
Property changes on: chrome/browser/plugin_process_host_mac.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698