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

Side by Side Diff: content/renderer/browser_plugin/browser_plugin_manager_impl.cc

Issue 11035067: Add loadCommit and loadStop Event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Comments and Nits Created 8 years, 2 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/renderer/browser_plugin/browser_plugin_manager_impl.h" 5 #include "content/renderer/browser_plugin/browser_plugin_manager_impl.h"
6 6
7 #include "content/common/browser_plugin_messages.h" 7 #include "content/common/browser_plugin_messages.h"
8 #include "content/renderer/browser_plugin/browser_plugin.h" 8 #include "content/renderer/browser_plugin/browser_plugin.h"
9 #include "content/renderer/render_thread_impl.h" 9 #include "content/renderer/render_thread_impl.h"
10 10
(...skipping 19 matching lines...) Expand all
30 return RenderThread::Get()->Send(msg); 30 return RenderThread::Get()->Send(msg);
31 } 31 }
32 32
33 bool BrowserPluginManagerImpl::OnControlMessageReceived( 33 bool BrowserPluginManagerImpl::OnControlMessageReceived(
34 const IPC::Message& message) { 34 const IPC::Message& message) {
35 DCHECK(CalledOnValidThread()); 35 DCHECK(CalledOnValidThread());
36 bool handled = true; 36 bool handled = true;
37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message) 37 IPC_BEGIN_MESSAGE_MAP(BrowserPluginManagerImpl, message)
38 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect) 38 IPC_MESSAGE_HANDLER(BrowserPluginMsg_UpdateRect, OnUpdateRect)
39 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed, OnGuestCrashed) 39 IPC_MESSAGE_HANDLER(BrowserPluginMsg_GuestCrashed, OnGuestCrashed)
40 IPC_MESSAGE_HANDLER(BrowserPluginMsg_DidNavigate, OnDidNavigate)
41 IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus) 40 IPC_MESSAGE_HANDLER(BrowserPluginMsg_AdvanceFocus, OnAdvanceFocus)
42 IPC_MESSAGE_HANDLER(BrowserPluginMsg_ShouldAcceptTouchEvents, 41 IPC_MESSAGE_HANDLER(BrowserPluginMsg_ShouldAcceptTouchEvents,
43 OnShouldAcceptTouchEvents) 42 OnShouldAcceptTouchEvents)
44 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStart, OnLoadStart) 43 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStart, OnLoadStart)
45 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadAbort, OnLoadAbort) 44 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadAbort, OnLoadAbort)
46 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadRedirect, OnLoadRedirect) 45 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadRedirect, OnLoadRedirect)
46 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadCommit, OnLoadCommit)
47 IPC_MESSAGE_HANDLER(BrowserPluginMsg_LoadStop, OnLoadStop)
47 IPC_MESSAGE_UNHANDLED(handled = false) 48 IPC_MESSAGE_UNHANDLED(handled = false)
48 IPC_END_MESSAGE_MAP() 49 IPC_END_MESSAGE_MAP()
49 return handled; 50 return handled;
50 } 51 }
51 52
52 void BrowserPluginManagerImpl::OnUpdateRect( 53 void BrowserPluginManagerImpl::OnUpdateRect(
53 int instance_id, 54 int instance_id,
54 int message_id, 55 int message_id,
55 const BrowserPluginMsg_UpdateRect_Params& params) { 56 const BrowserPluginMsg_UpdateRect_Params& params) {
56 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 57 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
57 if (plugin) 58 if (plugin)
58 plugin->UpdateRect(message_id, params); 59 plugin->UpdateRect(message_id, params);
59 } 60 }
60 61
61 void BrowserPluginManagerImpl::OnGuestCrashed(int instance_id) { 62 void BrowserPluginManagerImpl::OnGuestCrashed(int instance_id) {
62 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 63 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
63 if (plugin) 64 if (plugin)
64 plugin->GuestCrashed(); 65 plugin->GuestCrashed();
65 } 66 }
66 67
67 void BrowserPluginManagerImpl::OnDidNavigate(int instance_id, 68 void BrowserPluginManagerImpl::OnLoadCommit(int instance_id,
68 const GURL& url, 69 const GURL& url,
69 int process_id) { 70 int process_id,
71 bool is_main_frame) {
72 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
73 if (plugin)
74 plugin->LoadCommit(url, process_id, is_main_frame);
75 }
76
77 void BrowserPluginManagerImpl::OnLoadStop(int instance_id) {
70 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 78 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
71 if (plugin) 79 if (plugin)
72 plugin->DidNavigate(url, process_id); 80 plugin->LoadStop();
73 } 81 }
74 82
75 void BrowserPluginManagerImpl::OnAdvanceFocus(int instance_id, bool reverse) { 83 void BrowserPluginManagerImpl::OnAdvanceFocus(int instance_id, bool reverse) {
76 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 84 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
77 if (plugin) 85 if (plugin)
78 plugin->AdvanceFocus(reverse); 86 plugin->AdvanceFocus(reverse);
79 } 87 }
80 88
81 void BrowserPluginManagerImpl::OnShouldAcceptTouchEvents(int instance_id, 89 void BrowserPluginManagerImpl::OnShouldAcceptTouchEvents(int instance_id,
82 bool accept) { 90 bool accept) {
(...skipping 22 matching lines...) Expand all
105 void BrowserPluginManagerImpl::OnLoadRedirect(int instance_id, 113 void BrowserPluginManagerImpl::OnLoadRedirect(int instance_id,
106 const GURL& old_url, 114 const GURL& old_url,
107 const GURL& new_url, 115 const GURL& new_url,
108 bool is_top_level) { 116 bool is_top_level) {
109 BrowserPlugin* plugin = GetBrowserPlugin(instance_id); 117 BrowserPlugin* plugin = GetBrowserPlugin(instance_id);
110 if (plugin) 118 if (plugin)
111 plugin->LoadRedirect(old_url, new_url, is_top_level); 119 plugin->LoadRedirect(old_url, new_url, is_top_level);
112 } 120 }
113 121
114 } // namespace content 122 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698