| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 <Carbon/Carbon.h> | 5 #include <Carbon/Carbon.h> |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 plugin_visible_windows_set_.insert(window_id); | 23 plugin_visible_windows_set_.insert(window_id); |
| 24 CGRect window_bounds = { | 24 CGRect window_bounds = { |
| 25 { window_rect.x(), window_rect.y() }, | 25 { window_rect.x(), window_rect.y() }, |
| 26 { window_rect.width(), window_rect.height() } | 26 { window_rect.width(), window_rect.height() } |
| 27 }; | 27 }; |
| 28 CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID()); | 28 CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID()); |
| 29 if (CGRectEqualToRect(window_bounds, main_display_bounds)) { | 29 if (CGRectEqualToRect(window_bounds, main_display_bounds)) { |
| 30 plugin_fullscreen_windows_set_.insert(window_id); | 30 plugin_fullscreen_windows_set_.insert(window_id); |
| 31 // If the plugin has just shown a window that's the same dimensions as | 31 // If the plugin has just shown a window that's the same dimensions as |
| 32 // the main display, hide the menubar so that it has the whole screen. | 32 // the main display, hide the menubar so that it has the whole screen. |
| 33 ChromeThread::GetMessageLoop(ChromeThread::UI)->PostTask(FROM_HERE, | 33 ChromeThread::PostTask( |
| 34 ChromeThread::UI, FROM_HERE, |
| 34 NewRunnableFunction(mac_util::RequestFullScreen)); | 35 NewRunnableFunction(mac_util::RequestFullScreen)); |
| 35 } | 36 } |
| 36 } | 37 } |
| 37 | 38 |
| 38 void PluginProcessHost::OnPluginHideWindow(uint32 window_id, | 39 void PluginProcessHost::OnPluginHideWindow(uint32 window_id, |
| 39 gfx::Rect window_rect) { | 40 gfx::Rect window_rect) { |
| 40 plugin_visible_windows_set_.erase(window_id); | 41 plugin_visible_windows_set_.erase(window_id); |
| 41 if (plugin_fullscreen_windows_set_.find(window_id) != | 42 if (plugin_fullscreen_windows_set_.find(window_id) != |
| 42 plugin_fullscreen_windows_set_.end()) { | 43 plugin_fullscreen_windows_set_.end()) { |
| 43 plugin_fullscreen_windows_set_.erase(window_id); | 44 plugin_fullscreen_windows_set_.erase(window_id); |
| 44 ChromeThread::GetMessageLoop(ChromeThread::UI)->PostTask(FROM_HERE, | 45 ChromeThread::PostTask( |
| 46 ChromeThread::UI, FROM_HERE, |
| 45 NewRunnableFunction(mac_util::ReleaseFullScreen)); | 47 NewRunnableFunction(mac_util::ReleaseFullScreen)); |
| 46 } | 48 } |
| 47 } | 49 } |
| 48 | 50 |
| 49 void PluginProcessHost::OnPluginDisposeWindow(uint32 window_id, | 51 void PluginProcessHost::OnPluginDisposeWindow(uint32 window_id, |
| 50 gfx::Rect window_rect) { | 52 gfx::Rect window_rect) { |
| 51 OnPluginHideWindow(window_id, window_rect); | 53 OnPluginHideWindow(window_id, window_rect); |
| 52 } | 54 } |
| OLD | NEW |