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/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 props[kIsTopLevel] = base::Value::CreateBooleanValue(is_top_level); | 606 props[kIsTopLevel] = base::Value::CreateBooleanValue(is_top_level); |
607 | 607 |
608 TriggerEvent(kEventLoadStart, &props); | 608 TriggerEvent(kEventLoadStart, &props); |
609 } | 609 } |
610 | 610 |
611 void BrowserPlugin::LoadCommit( | 611 void BrowserPlugin::LoadCommit( |
612 const BrowserPluginMsg_LoadCommit_Params& params) { | 612 const BrowserPluginMsg_LoadCommit_Params& params) { |
613 // If the guest has just committed a new navigation then it is no longer | 613 // If the guest has just committed a new navigation then it is no longer |
614 // crashed. | 614 // crashed. |
615 guest_crashed_ = false; | 615 guest_crashed_ = false; |
616 src_ = params.url.spec(); | 616 if (params.is_top_level) |
| 617 src_ = params.url.spec(); |
617 process_id_ = params.process_id; | 618 process_id_ = params.process_id; |
618 current_nav_entry_index_ = params.current_entry_index; | 619 current_nav_entry_index_ = params.current_entry_index; |
619 nav_entry_count_ = params.entry_count; | 620 nav_entry_count_ = params.entry_count; |
620 | 621 |
621 std::map<std::string, base::Value*> props; | 622 std::map<std::string, base::Value*> props; |
622 props[kURL] = base::Value::CreateStringValue(src_); | 623 props[kURL] = base::Value::CreateStringValue(params.url.spec()); |
623 props[kIsTopLevel] = base::Value::CreateBooleanValue(params.is_top_level); | 624 props[kIsTopLevel] = base::Value::CreateBooleanValue(params.is_top_level); |
624 TriggerEvent(kEventLoadCommit, &props); | 625 TriggerEvent(kEventLoadCommit, &props); |
625 } | 626 } |
626 | 627 |
627 void BrowserPlugin::LoadStop() { | 628 void BrowserPlugin::LoadStop() { |
628 // Construct the loadStop event object. | 629 // Construct the loadStop event object. |
629 TriggerEvent(kEventLoadStop, NULL); | 630 TriggerEvent(kEventLoadStop, NULL); |
630 } | 631 } |
631 | 632 |
632 void BrowserPlugin::LoadAbort(const GURL& url, | 633 void BrowserPlugin::LoadAbort(const GURL& url, |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 void* notify_data) { | 978 void* notify_data) { |
978 } | 979 } |
979 | 980 |
980 void BrowserPlugin::didFailLoadingFrameRequest( | 981 void BrowserPlugin::didFailLoadingFrameRequest( |
981 const WebKit::WebURL& url, | 982 const WebKit::WebURL& url, |
982 void* notify_data, | 983 void* notify_data, |
983 const WebKit::WebURLError& error) { | 984 const WebKit::WebURLError& error) { |
984 } | 985 } |
985 | 986 |
986 } // namespace content | 987 } // namespace content |
OLD | NEW |