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

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

Issue 11412279: Browser Plugin: Only update src attribute on top-level navigations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated BrowserPluginTest.CustomEvents to cover this change Created 8 years 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
« no previous file with comments | « no previous file | content/renderer/browser_plugin/browser_plugin_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/renderer/browser_plugin/browser_plugin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698