| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/plugin_process_host.h" | 5 #include "chrome/browser/plugin_process_host.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "net/base/cookie_store.h" | 41 #include "net/base/cookie_store.h" |
| 42 #include "net/base/io_buffer.h" | 42 #include "net/base/io_buffer.h" |
| 43 #include "net/url_request/url_request.h" | 43 #include "net/url_request/url_request.h" |
| 44 #include "net/url_request/url_request_context.h" | 44 #include "net/url_request/url_request_context.h" |
| 45 | 45 |
| 46 #if defined(USE_X11) | 46 #if defined(USE_X11) |
| 47 #include "gfx/gtk_native_view_id_manager.h" | 47 #include "gfx/gtk_native_view_id_manager.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 #if defined(OS_MACOSX) | 50 #if defined(OS_MACOSX) |
| 51 #include "base/mac_util.h" | 51 #include "base/mac/mac_util.h" |
| 52 #include "chrome/common/plugin_carbon_interpose_constants_mac.h" | 52 #include "chrome/common/plugin_carbon_interpose_constants_mac.h" |
| 53 #include "gfx/rect.h" | 53 #include "gfx/rect.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 static const char kDefaultPluginFinderURL[] = | 56 static const char kDefaultPluginFinderURL[] = |
| 57 "https://dl-ssl.google.com/edgedl/chrome/plugins/plugins2.xml"; | 57 "https://dl-ssl.google.com/edgedl/chrome/plugins/plugins2.xml"; |
| 58 | 58 |
| 59 namespace { | 59 namespace { |
| 60 | 60 |
| 61 // Helper class that we pass to ResourceMessageFilter so that it can find the | 61 // Helper class that we pass to ResourceMessageFilter so that it can find the |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 PostMessage(*window_index, WM_CLOSE, 0, 0); | 141 PostMessage(*window_index, WM_CLOSE, 0, 0); |
| 142 } | 142 } |
| 143 #elif defined(OS_MACOSX) | 143 #elif defined(OS_MACOSX) |
| 144 // If the plugin process crashed but had fullscreen windows open at the time, | 144 // If the plugin process crashed but had fullscreen windows open at the time, |
| 145 // make sure that the menu bar is visible. | 145 // make sure that the menu bar is visible. |
| 146 std::set<uint32>::iterator window_index; | 146 std::set<uint32>::iterator window_index; |
| 147 for (window_index = plugin_fullscreen_windows_set_.begin(); | 147 for (window_index = plugin_fullscreen_windows_set_.begin(); |
| 148 window_index != plugin_fullscreen_windows_set_.end(); | 148 window_index != plugin_fullscreen_windows_set_.end(); |
| 149 window_index++) { | 149 window_index++) { |
| 150 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 150 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 151 mac_util::ReleaseFullScreen(mac_util::kFullScreenModeHideAll); | 151 base::mac::ReleaseFullScreen(base::mac::kFullScreenModeHideAll); |
| 152 } else { | 152 } else { |
| 153 BrowserThread::PostTask( | 153 BrowserThread::PostTask( |
| 154 BrowserThread::UI, FROM_HERE, | 154 BrowserThread::UI, FROM_HERE, |
| 155 NewRunnableFunction(mac_util::ReleaseFullScreen, | 155 NewRunnableFunction(base::mac::ReleaseFullScreen, |
| 156 mac_util::kFullScreenModeHideAll)); | 156 base::mac::kFullScreenModeHideAll)); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 // If the plugin hid the cursor, reset that. | 159 // If the plugin hid the cursor, reset that. |
| 160 if (!plugin_cursor_visible_) { | 160 if (!plugin_cursor_visible_) { |
| 161 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 161 if (BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 162 mac_util::SetCursorVisibility(true); | 162 base::mac::SetCursorVisibility(true); |
| 163 } else { | 163 } else { |
| 164 BrowserThread::PostTask( | 164 BrowserThread::PostTask( |
| 165 BrowserThread::UI, FROM_HERE, | 165 BrowserThread::UI, FROM_HERE, |
| 166 NewRunnableFunction(mac_util::SetCursorVisibility, | 166 NewRunnableFunction(base::mac::SetCursorVisibility, |
| 167 true)); | 167 true)); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 #endif | 170 #endif |
| 171 // Cancel all pending and sent requests. | 171 // Cancel all pending and sent requests. |
| 172 CancelRequests(); | 172 CancelRequests(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, | 175 bool PluginProcessHost::Init(const webkit::npapi::WebPluginInfo& info, |
| 176 const std::string& locale) { | 176 const std::string& locale) { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 const std::vector<uint8>& data) { | 467 const std::vector<uint8>& data) { |
| 468 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 468 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 469 | 469 |
| 470 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); | 470 ChromePluginLib *chrome_plugin = ChromePluginLib::Find(info_.path); |
| 471 if (chrome_plugin) { | 471 if (chrome_plugin) { |
| 472 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); | 472 void *data_ptr = const_cast<void*>(reinterpret_cast<const void*>(&data[0])); |
| 473 uint32 data_len = static_cast<uint32>(data.size()); | 473 uint32 data_len = static_cast<uint32>(data.size()); |
| 474 chrome_plugin->functions().on_message(data_ptr, data_len); | 474 chrome_plugin->functions().on_message(data_ptr, data_len); |
| 475 } | 475 } |
| 476 } | 476 } |
| OLD | NEW |