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

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

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications 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 | Annotate | Revision Log
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 12 matching lines...) Expand all
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698