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

Unified Diff: extensions/browser/guest_view/extension_options/extension_options_guest.cc

Issue 618823002: GuestView: Move lifetime management out of content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comment Created 6 years, 3 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
Index: extensions/browser/guest_view/extension_options/extension_options_guest.cc
diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
index 32b5dcea6f36f917def5d0c390b936d01c96937a..ef79ee704918a5a009fff7995a441d0950e0be8f 100644
--- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
+++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
@@ -40,7 +40,8 @@ ExtensionOptionsGuest::ExtensionOptionsGuest(
: GuestView<ExtensionOptionsGuest>(browser_context, guest_instance_id),
extension_options_guest_delegate_(
extensions::ExtensionsAPIClient::Get()
- ->CreateExtensionOptionsGuestDelegate(this)) {
+ ->CreateExtensionOptionsGuestDelegate(this)),
+ has_navigated_(false) {
}
ExtensionOptionsGuest::~ExtensionOptionsGuest() {
@@ -108,10 +109,16 @@ void ExtensionOptionsGuest::CreateWebContents(
void ExtensionOptionsGuest::DidAttachToEmbedder() {
SetUpAutoSize();
+
+ // We should not re-navigate on reattachment.
+ if (has_navigated_)
+ return;
+
web_contents()->GetController().LoadURL(options_page_,
content::Referrer(),
ui::PAGE_TRANSITION_LINK,
std::string());
+ has_navigated_ = true;
}
void ExtensionOptionsGuest::DidInitialize() {

Powered by Google App Engine
This is Rietveld 408576698