OLD | NEW |
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.h" | 5 #include "content/renderer/browser_plugin/browser_plugin.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #if defined (OS_WIN) | 9 #if defined (OS_WIN) |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 WebKit::WebFrame* frame, | 55 WebKit::WebFrame* frame, |
56 const WebPluginParams& params) | 56 const WebPluginParams& params) |
57 : instance_id_(instance_id), | 57 : instance_id_(instance_id), |
58 render_view_(render_view), | 58 render_view_(render_view), |
59 container_(NULL), | 59 container_(NULL), |
60 damage_buffer_(NULL), | 60 damage_buffer_(NULL), |
61 sad_guest_(NULL), | 61 sad_guest_(NULL), |
62 guest_crashed_(false), | 62 guest_crashed_(false), |
63 resize_pending_(false), | 63 resize_pending_(false), |
64 navigate_src_sent_(false), | 64 navigate_src_sent_(false), |
65 parent_frame_(frame->identifier()), | |
66 process_id_(-1), | 65 process_id_(-1), |
67 persist_storage_(false) { | 66 persist_storage_(false) { |
68 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); | 67 BrowserPluginManager::Get()->AddBrowserPlugin(instance_id, this); |
69 bindings_.reset(new BrowserPluginBindings(this)); | 68 bindings_.reset(new BrowserPluginBindings(this)); |
70 | 69 |
71 ParseAttributes(params); | 70 ParseAttributes(params); |
72 } | 71 } |
73 | 72 |
74 BrowserPlugin::~BrowserPlugin() { | 73 BrowserPlugin::~BrowserPlugin() { |
75 if (damage_buffer_) { | 74 if (damage_buffer_) { |
(...skipping 20 matching lines...) Expand all Loading... |
96 } | 95 } |
97 | 96 |
98 void BrowserPlugin::SetSrcAttribute(const std::string& src) { | 97 void BrowserPlugin::SetSrcAttribute(const std::string& src) { |
99 if (src == src_ && !guest_crashed_) | 98 if (src == src_ && !guest_crashed_) |
100 return; | 99 return; |
101 if (!src.empty() || navigate_src_sent_) { | 100 if (!src.empty() || navigate_src_sent_) { |
102 BrowserPluginManager::Get()->Send( | 101 BrowserPluginManager::Get()->Send( |
103 new BrowserPluginHostMsg_NavigateGuest( | 102 new BrowserPluginHostMsg_NavigateGuest( |
104 render_view_->GetRoutingID(), | 103 render_view_->GetRoutingID(), |
105 instance_id_, | 104 instance_id_, |
106 parent_frame_, | |
107 src, | 105 src, |
108 gfx::Size(width(), height()))); | 106 gfx::Size(width(), height()))); |
109 // Record that we sent a NavigateGuest message to embedder. Once we send | 107 // Record that we sent a NavigateGuest message to embedder. Once we send |
110 // such a message, subsequent SetSrcAttribute() calls must always send | 108 // such a message, subsequent SetSrcAttribute() calls must always send |
111 // NavigateGuest messages to the embedder (even if |src| is empty), so | 109 // NavigateGuest messages to the embedder (even if |src| is empty), so |
112 // resize works correctly for all cases (e.g. The embedder can reset the | 110 // resize works correctly for all cases (e.g. The embedder can reset the |
113 // guest's |src| to empty value, resize and then set the |src| to a | 111 // guest's |src| to empty value, resize and then set the |src| to a |
114 // non-empty value). | 112 // non-empty value). |
115 // Additionally, once this instance has navigated, the storage partition | 113 // Additionally, once this instance has navigated, the storage partition |
116 // cannot be changed, so this value is used for enforcing this. | 114 // cannot be changed, so this value is used for enforcing this. |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 void* notify_data) { | 522 void* notify_data) { |
525 } | 523 } |
526 | 524 |
527 void BrowserPlugin::didFailLoadingFrameRequest( | 525 void BrowserPlugin::didFailLoadingFrameRequest( |
528 const WebKit::WebURL& url, | 526 const WebKit::WebURL& url, |
529 void* notify_data, | 527 void* notify_data, |
530 const WebKit::WebURLError& error) { | 528 const WebKit::WebURLError& error) { |
531 } | 529 } |
532 | 530 |
533 } // namespace content | 531 } // namespace content |
OLD | NEW |