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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 15149006: <webview>: Plumb edit commands (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed fprintf Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_HandleInputEvent, 343 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_HandleInputEvent,
344 OnHandleInputEvent) 344 OnHandleInputEvent)
345 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_LockMouse_ACK, OnLockMouseAck) 345 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_LockMouse_ACK, OnLockMouseAck)
346 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest, OnNavigateGuest) 346 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_NavigateGuest, OnNavigateGuest)
347 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed, OnPluginDestroyed) 347 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_PluginDestroyed, OnPluginDestroyed)
348 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Reload, OnReload) 348 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Reload, OnReload)
349 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ResizeGuest, OnResizeGuest) 349 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_ResizeGuest, OnResizeGuest)
350 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_RespondPermission, 350 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_RespondPermission,
351 OnRespondPermission) 351 OnRespondPermission)
352 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetAutoSize, OnSetSize) 352 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetAutoSize, OnSetSize)
353 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent,
354 OnSetEditCommandsForNextKeyEvent)
353 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus) 355 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetFocus, OnSetFocus)
354 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetName, OnSetName) 356 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetName, OnSetName)
355 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetVisibility, OnSetVisibility) 357 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_SetVisibility, OnSetVisibility)
356 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Stop, OnStop) 358 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_Stop, OnStop)
357 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_TerminateGuest, OnTerminateGuest) 359 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_TerminateGuest, OnTerminateGuest)
358 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UnlockMouse_ACK, OnUnlockMouseAck) 360 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UnlockMouse_ACK, OnUnlockMouseAck)
359 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateGeometry, OnUpdateGeometry) 361 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateGeometry, OnUpdateGeometry)
360 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateRect_ACK, OnUpdateRectACK) 362 IPC_MESSAGE_HANDLER(BrowserPluginHostMsg_UpdateRect_ACK, OnUpdateRectACK)
361 IPC_MESSAGE_UNHANDLED(handled = false) 363 IPC_MESSAGE_UNHANDLED(handled = false)
362 IPC_END_MESSAGE_MAP() 364 IPC_END_MESSAGE_MAP()
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 case BrowserPluginHostMsg_ExecuteEditCommand::ID: 971 case BrowserPluginHostMsg_ExecuteEditCommand::ID:
970 case BrowserPluginHostMsg_Go::ID: 972 case BrowserPluginHostMsg_Go::ID:
971 case BrowserPluginHostMsg_HandleInputEvent::ID: 973 case BrowserPluginHostMsg_HandleInputEvent::ID:
972 case BrowserPluginHostMsg_LockMouse_ACK::ID: 974 case BrowserPluginHostMsg_LockMouse_ACK::ID:
973 case BrowserPluginHostMsg_NavigateGuest::ID: 975 case BrowserPluginHostMsg_NavigateGuest::ID:
974 case BrowserPluginHostMsg_PluginDestroyed::ID: 976 case BrowserPluginHostMsg_PluginDestroyed::ID:
975 case BrowserPluginHostMsg_Reload::ID: 977 case BrowserPluginHostMsg_Reload::ID:
976 case BrowserPluginHostMsg_ResizeGuest::ID: 978 case BrowserPluginHostMsg_ResizeGuest::ID:
977 case BrowserPluginHostMsg_RespondPermission::ID: 979 case BrowserPluginHostMsg_RespondPermission::ID:
978 case BrowserPluginHostMsg_SetAutoSize::ID: 980 case BrowserPluginHostMsg_SetAutoSize::ID:
981 case BrowserPluginHostMsg_SetEditCommandsForNextKeyEvent::ID:
979 case BrowserPluginHostMsg_SetFocus::ID: 982 case BrowserPluginHostMsg_SetFocus::ID:
980 case BrowserPluginHostMsg_SetName::ID: 983 case BrowserPluginHostMsg_SetName::ID:
981 case BrowserPluginHostMsg_SetVisibility::ID: 984 case BrowserPluginHostMsg_SetVisibility::ID:
982 case BrowserPluginHostMsg_Stop::ID: 985 case BrowserPluginHostMsg_Stop::ID:
983 case BrowserPluginHostMsg_TerminateGuest::ID: 986 case BrowserPluginHostMsg_TerminateGuest::ID:
984 case BrowserPluginHostMsg_UnlockMouse_ACK::ID: 987 case BrowserPluginHostMsg_UnlockMouse_ACK::ID:
985 case BrowserPluginHostMsg_UpdateGeometry::ID: 988 case BrowserPluginHostMsg_UpdateGeometry::ID:
986 case BrowserPluginHostMsg_UpdateRect_ACK::ID: 989 case BrowserPluginHostMsg_UpdateRect_ACK::ID:
987 return true; 990 return true;
988 default: 991 default:
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 // However, even in that case, layout may not change and so we may 1316 // However, even in that case, layout may not change and so we may
1314 // not get a full frame worth of pixels. 1317 // not get a full frame worth of pixels.
1315 Send(new ViewMsg_Repaint(routing_id(), max_auto_size_)); 1318 Send(new ViewMsg_Repaint(routing_id(), max_auto_size_));
1316 } else if (!auto_size_enabled_ && old_auto_size_enabled) { 1319 } else if (!auto_size_enabled_ && old_auto_size_enabled) {
1317 GetWebContents()->GetRenderViewHost()->DisableAutoResize( 1320 GetWebContents()->GetRenderViewHost()->DisableAutoResize(
1318 resize_guest_params.view_rect.size()); 1321 resize_guest_params.view_rect.size());
1319 } 1322 }
1320 OnResizeGuest(instance_id_, resize_guest_params); 1323 OnResizeGuest(instance_id_, resize_guest_params);
1321 } 1324 }
1322 1325
1326 void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent(
1327 int instance_id,
1328 const std::vector<EditCommand>& edit_commands) {
1329 Send(new InputMsg_SetEditCommandsForNextKeyEvent(routing_id(),
1330 edit_commands));
1331 }
1332
1323 void BrowserPluginGuest::OnSetVisibility(int instance_id, bool visible) { 1333 void BrowserPluginGuest::OnSetVisibility(int instance_id, bool visible) {
1324 guest_visible_ = visible; 1334 guest_visible_ = visible;
1325 if (embedder_visible_ && guest_visible_) 1335 if (embedder_visible_ && guest_visible_)
1326 GetWebContents()->WasShown(); 1336 GetWebContents()->WasShown();
1327 else 1337 else
1328 GetWebContents()->WasHidden(); 1338 GetWebContents()->WasHidden();
1329 } 1339 }
1330 1340
1331 void BrowserPluginGuest::OnStop(int instance_id) { 1341 void BrowserPluginGuest::OnStop(int instance_id) {
1332 GetWebContents()->Stop(); 1342 GetWebContents()->Stop();
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 base::Value::CreateStringValue(request_method)); 1557 base::Value::CreateStringValue(request_method));
1548 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); 1558 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url));
1549 1559
1550 SendMessageToEmbedder( 1560 SendMessageToEmbedder(
1551 new BrowserPluginMsg_RequestPermission(instance_id(), 1561 new BrowserPluginMsg_RequestPermission(instance_id(),
1552 BrowserPluginPermissionTypeDownload, permission_request_id, 1562 BrowserPluginPermissionTypeDownload, permission_request_id,
1553 request_info)); 1563 request_info));
1554 } 1564 }
1555 1565
1556 } // namespace content 1566 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.h ('k') | content/common/browser_plugin/browser_plugin_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698