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

Side by Side Diff: chrome/browser/plugin_process_host_mac.cc

Issue 402028: Only request full-screen once per plugin window (Closed)
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698