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

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

Issue 9150017: Add a Content API around BrowserChildProcessHost, similar to what was done with ChildProcessHost.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix?! Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/plugin_process_host.cc ('k') | content/browser/plugin_service_impl.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/mac/mac_util.h" 13 #include "base/mac/mac_util.h"
14 #include "base/process_util.h"
15 #include "content/browser/browser_child_process_host.h"
14 #include "content/browser/plugin_process_host.h" 16 #include "content/browser/plugin_process_host.h"
15 #include "content/common/plugin_messages.h" 17 #include "content/common/plugin_messages.h"
16 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
19 #include "content/public/browser/child_process_data.h"
17 #include "ui/gfx/rect.h" 20 #include "ui/gfx/rect.h"
18 21
19 using content::BrowserThread; 22 using content::BrowserThread;
20 23
21 void PluginProcessHost::OnPluginSelectWindow(uint32 window_id, 24 void PluginProcessHost::OnPluginSelectWindow(uint32 window_id,
22 gfx::Rect window_rect, 25 gfx::Rect window_rect,
23 bool modal) { 26 bool modal) {
24 plugin_visible_windows_set_.insert(window_id); 27 plugin_visible_windows_set_.insert(window_id);
25 if (modal) 28 if (modal)
26 plugin_modal_windows_set_.insert(window_id); 29 plugin_modal_windows_set_.insert(window_id);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 gfx::Rect window_rect) { 71 gfx::Rect window_rect) {
69 bool had_windows = !plugin_visible_windows_set_.empty(); 72 bool had_windows = !plugin_visible_windows_set_.empty();
70 plugin_visible_windows_set_.erase(window_id); 73 plugin_visible_windows_set_.erase(window_id);
71 bool browser_needs_activation = had_windows && 74 bool browser_needs_activation = had_windows &&
72 plugin_visible_windows_set_.empty(); 75 plugin_visible_windows_set_.empty();
73 76
74 plugin_modal_windows_set_.erase(window_id); 77 plugin_modal_windows_set_.erase(window_id);
75 if (plugin_fullscreen_windows_set_.find(window_id) != 78 if (plugin_fullscreen_windows_set_.find(window_id) !=
76 plugin_fullscreen_windows_set_.end()) { 79 plugin_fullscreen_windows_set_.end()) {
77 plugin_fullscreen_windows_set_.erase(window_id); 80 plugin_fullscreen_windows_set_.erase(window_id);
78 pid_t plugin_pid = browser_needs_activation ? -1 : data().handle; 81 pid_t plugin_pid =
82 browser_needs_activation ? -1 : process_->GetData().handle;
79 browser_needs_activation = false; 83 browser_needs_activation = false;
80 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 84 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
81 base::Bind(ReleasePluginFullScreen, plugin_pid)); 85 base::Bind(ReleasePluginFullScreen, plugin_pid));
82 } 86 }
83 87
84 if (browser_needs_activation) { 88 if (browser_needs_activation) {
85 BrowserThread::PostTask( 89 BrowserThread::PostTask(
86 BrowserThread::UI, FROM_HERE, 90 BrowserThread::UI, FROM_HERE,
87 base::Bind(base::mac::ActivateProcess, base::GetCurrentProcId())); 91 base::Bind(base::mac::ActivateProcess, base::GetCurrentProcId()));
88 } 92 }
89 } 93 }
90 94
91 void PluginProcessHost::OnAppActivation() { 95 void PluginProcessHost::OnAppActivation() {
92 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
93 97
94 // If our plugin process has any modal windows up, we need to bring it forward 98 // If our plugin process has any modal windows up, we need to bring it forward
95 // so that they act more like an in-process modal window would. 99 // so that they act more like an in-process modal window would.
96 if (!plugin_modal_windows_set_.empty()) { 100 if (!plugin_modal_windows_set_.empty()) {
97 BrowserThread::PostTask( 101 BrowserThread::PostTask(
98 BrowserThread::UI, FROM_HERE, 102 BrowserThread::UI, FROM_HERE,
99 base::Bind(base::mac::ActivateProcess, data().handle)); 103 base::Bind(base::mac::ActivateProcess, process_->GetData().handle));
100 } 104 }
101 } 105 }
102 106
103 void PluginProcessHost::OnPluginSetCursorVisibility(bool visible) { 107 void PluginProcessHost::OnPluginSetCursorVisibility(bool visible) {
104 if (plugin_cursor_visible_ != visible) { 108 if (plugin_cursor_visible_ != visible) {
105 plugin_cursor_visible_ = visible; 109 plugin_cursor_visible_ = visible;
106 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 110 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
107 base::Bind(base::mac::SetCursorVisibility, 111 base::Bind(base::mac::SetCursorVisibility,
108 visible)); 112 visible));
109 } 113 }
110 } 114 }
OLDNEW
« no previous file with comments | « content/browser/plugin_process_host.cc ('k') | content/browser/plugin_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698