Chromium Code Reviews| Index: content/renderer/browser_plugin/browser_plugin.cc |
| diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc |
| index 3364c60142ebfe6bd019f6457b46883996a85b04..11622aaa6fa64969d0a79b583262ede8590c3f01 100644 |
| --- a/content/renderer/browser_plugin/browser_plugin.cc |
| +++ b/content/renderer/browser_plugin/browser_plugin.cc |
| @@ -60,6 +60,8 @@ BrowserPlugin::BrowserPlugin(RenderViewImpl* render_view, |
| visible_(true), |
| auto_navigate_(auto_navigate), |
| mouse_locked_(false), |
| + attach_called_(false), |
| + seen_src_(false), |
| browser_plugin_manager_(render_view->GetBrowserPluginManager()), |
| embedder_frame_url_(frame->document().url()), |
| weak_ptr_factory_(this) { |
| @@ -265,8 +267,17 @@ void BrowserPlugin::UpdateGuestAutoSizeState(bool auto_size_enabled) { |
| resize_guest_params)); |
| } |
| +void BrowserPlugin::AttachToPlugin( |
| + int instance_id) { |
| + printf("AttachToPlugin: attach_called_ to true\n"); |
| + attach_called_ = true; |
| + pending_instance_id_ = instance_id; |
| + MaybeAttach(); |
| +} |
| + |
| void BrowserPlugin::Attach(int guest_instance_id, |
| scoped_ptr<base::DictionaryValue> extra_params) { |
| + printf("BP::Attach\n"); |
| CHECK(guest_instance_id != browser_plugin::kInstanceIDNone); |
| // If this BrowserPlugin is already attached to a guest, then do nothing. |
| @@ -850,9 +861,26 @@ void BrowserPlugin::didReceiveData(const char* data, int data_length) { |
| } |
| void BrowserPlugin::didFinishLoading() { |
| + printf("BP::didFinishLoading\n"); |
| + printf("html_string_: %s\n", html_string_.c_str()); |
| if (auto_navigate_) { |
| + seen_src_ = true; |
| + printf("Set seen_src_ to true\n"); |
| + MaybeAttach(); |
| // TODO(lazyboy): Make |auto_navigate_| stuff work. |
| - UpdateDOMAttribute(content::browser_plugin::kAttributeSrc, html_string_); |
| + //UpdateDOMAttribute(content::browser_plugin::kAttributeSrc, html_string_); |
| + } |
| +} |
| + |
| +void BrowserPlugin::MaybeAttach() { |
| + printf("MaybeAttach: seen_src_ = %d, attach_called_: %d\n", |
| + seen_src_, attach_called_); |
| + if (seen_src_ && attach_called_) { |
|
Fady Samuel
2014/07/09 14:54:17
I'd love to move autonavigate code out of content
lazyboy
2014/07/10 04:11:00
We need a renderer side counterpart in chrome/ for
Fady Samuel
2014/07/10 15:13:42
I think that's fine. Let's get something working a
|
| + // We have all we need. |
| + printf("pending_instance_id_: %d\n", pending_instance_id_); |
| + base::DictionaryValue* v = new base::DictionaryValue(); |
| + v->SetString("src", html_string_); |
| + Attach(pending_instance_id_, make_scoped_ptr(v)); |
| } |
| } |