| 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 14 matching lines...) Expand all Loading... |
| 25 gfx::Rect window_rect, | 25 gfx::Rect window_rect, |
| 26 bool modal) { | 26 bool modal) { |
| 27 plugin_visible_windows_set_.insert(window_id); | 27 plugin_visible_windows_set_.insert(window_id); |
| 28 if (modal) | 28 if (modal) |
| 29 plugin_modal_windows_set_.insert(window_id); | 29 plugin_modal_windows_set_.insert(window_id); |
| 30 CGRect window_bounds = { | 30 CGRect window_bounds = { |
| 31 { window_rect.x(), window_rect.y() }, | 31 { window_rect.x(), window_rect.y() }, |
| 32 { window_rect.width(), window_rect.height() } | 32 { window_rect.width(), window_rect.height() } |
| 33 }; | 33 }; |
| 34 CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID()); | 34 CGRect main_display_bounds = CGDisplayBounds(CGMainDisplayID()); |
| 35 if (CGRectEqualToRect(window_bounds, main_display_bounds)) { | 35 if (CGRectEqualToRect(window_bounds, main_display_bounds) && |
| 36 (plugin_fullscreen_windows_set_.find(window_id) == |
| 37 plugin_fullscreen_windows_set_.end())) { |
| 36 plugin_fullscreen_windows_set_.insert(window_id); | 38 plugin_fullscreen_windows_set_.insert(window_id); |
| 37 // If the plugin has just shown a window that's the same dimensions as | 39 // If the plugin has just shown a window that's the same dimensions as |
| 38 // the main display, hide the menubar so that it has the whole screen. | 40 // the main display, hide the menubar so that it has the whole screen. |
| 41 // (but only if we haven't already seen this fullscreen window, since |
| 42 // otherwise our refcounting can get skewed). |
| 39 ChromeThread::PostTask( | 43 ChromeThread::PostTask( |
| 40 ChromeThread::UI, FROM_HERE, | 44 ChromeThread::UI, FROM_HERE, |
| 41 NewRunnableFunction(mac_util::RequestFullScreen)); | 45 NewRunnableFunction(mac_util::RequestFullScreen)); |
| 42 } | 46 } |
| 43 } | 47 } |
| 44 | 48 |
| 45 void PluginProcessHost::OnPluginHideWindow(uint32 window_id, | 49 void PluginProcessHost::OnPluginHideWindow(uint32 window_id, |
| 46 gfx::Rect window_rect) { | 50 gfx::Rect window_rect) { |
| 47 plugin_visible_windows_set_.erase(window_id); | 51 plugin_visible_windows_set_.erase(window_id); |
| 48 plugin_modal_windows_set_.erase(window_id); | 52 plugin_modal_windows_set_.erase(window_id); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 64 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 68 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 65 | 69 |
| 66 // If our plugin process has any modal windows up, we need to bring it forward | 70 // If our plugin process has any modal windows up, we need to bring it forward |
| 67 // so that they act more like an in-process modal window would. | 71 // so that they act more like an in-process modal window would. |
| 68 if (!plugin_modal_windows_set_.empty()) { | 72 if (!plugin_modal_windows_set_.empty()) { |
| 69 ChromeThread::PostTask( | 73 ChromeThread::PostTask( |
| 70 ChromeThread::UI, FROM_HERE, | 74 ChromeThread::UI, FROM_HERE, |
| 71 NewRunnableFunction(mac_util::ActivateProcess, handle())); | 75 NewRunnableFunction(mac_util::ActivateProcess, handle())); |
| 72 } | 76 } |
| 73 } | 77 } |
| OLD | NEW |