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

Unified Diff: extensions/browser/guest_view/extension_view/extension_view_guest.cc

Issue 2659773003: Convert ExtensionViewGuest to use the new navigation callbacks. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/browser/guest_view/extension_view/extension_view_guest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/extension_view/extension_view_guest.cc
diff --git a/extensions/browser/guest_view/extension_view/extension_view_guest.cc b/extensions/browser/guest_view/extension_view/extension_view_guest.cc
index 08508011eb48ecffee594cb256554196020065c7..f12da996ec714e9c8d9f4ab20ff1658d5e5f8cea 100644
--- a/extensions/browser/guest_view/extension_view/extension_view_guest.cc
+++ b/extensions/browser/guest_view/extension_view/extension_view_guest.cc
@@ -9,6 +9,7 @@
#include "base/memory/ptr_util.h"
#include "components/crx_file/id_util.h"
#include "components/guest_view/browser/guest_view_event.h"
+#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/result_codes.h"
#include "extensions/browser/api/extensions_api_client.h"
@@ -117,14 +118,12 @@ int ExtensionViewGuest::GetTaskPrefix() const {
return IDS_EXTENSION_TASK_MANAGER_EXTENSIONVIEW_TAG_PREFIX;
}
-void ExtensionViewGuest::DidCommitProvisionalLoadForFrame(
- content::RenderFrameHost* render_frame_host,
- const GURL& url,
- ui::PageTransition transition_type) {
- if (render_frame_host->GetParent())
+void ExtensionViewGuest::DidFinishNavigation(
+ content::NavigationHandle* navigation_handle) {
+ if (!navigation_handle->HasCommitted() || !navigation_handle->IsInMainFrame())
return;
- url_ = url;
+ url_ = navigation_handle->GetURL();
std::unique_ptr<base::DictionaryValue> args(new base::DictionaryValue());
args->SetString(guest_view::kUrl, url_.spec());
@@ -132,15 +131,6 @@ void ExtensionViewGuest::DidCommitProvisionalLoadForFrame(
extensionview::kEventLoadCommit, std::move(args)));
}
-void ExtensionViewGuest::DidNavigateMainFrame(
- const content::LoadCommittedDetails& details,
- const content::FrameNavigateParams& params) {
- if (attached() && !url::IsSameOriginWith(params.url, url_)) {
Fady Samuel 2017/01/26 23:39:07 Do we want to allow navigating to a different orig
jam 2017/01/26 23:40:20 well before there were two different navigation ca
- bad_message::ReceivedBadMessage(web_contents()->GetRenderProcessHost(),
- bad_message::EVG_BAD_ORIGIN);
- }
-}
-
void ExtensionViewGuest::ApplyAttributes(const base::DictionaryValue& params) {
std::string src;
params.GetString(extensionview::kAttributeSrc, &src);
« no previous file with comments | « extensions/browser/guest_view/extension_view/extension_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698