Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / extensions / browser / guest_view / app_view / app_view_guest.cc
index e608a49..6e7d5b8 100644 (file)
@@ -20,7 +20,6 @@
 #include "extensions/browser/view_type_utils.h"
 #include "extensions/common/api/app_runtime.h"
 #include "extensions/common/extension_messages.h"
-#include "extensions/common/switches.h"
 #include "extensions/strings/grit/extensions_strings.h"
 #include "ipc/ipc_message_macros.h"
 
@@ -90,10 +89,6 @@ bool AppViewGuest::CompletePendingRequest(
 // static
 GuestViewBase* AppViewGuest::Create(content::BrowserContext* browser_context,
                                     int guest_instance_id) {
-  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
-      extensions::switches::kEnableAppView)) {
-    return NULL;
-  }
   return new AppViewGuest(browser_context, guest_instance_id);
 }
 
@@ -190,8 +185,7 @@ void AppViewGuest::CreateWebContents(
     return;
   }
 
-  ProcessManager* process_manager =
-      ExtensionSystem::Get(browser_context())->process_manager();
+  ProcessManager* process_manager = ProcessManager::Get(browser_context());
   ExtensionHost* host =
       process_manager->GetBackgroundHostForExtension(guest_extension->id());
   DCHECK(host);
@@ -203,8 +197,12 @@ void AppViewGuest::DidAttachToEmbedder() {
   // element. This means that the host element knows how to route input
   // events to the guest, and the guest knows how to get frames to the
   // embedder.
+  if (!url_.is_valid())
+    return;
+
   web_contents()->GetController().LoadURL(
       url_, content::Referrer(), ui::PAGE_TRANSITION_LINK, std::string());
+  url_ = GURL();
 }
 
 void AppViewGuest::DidInitialize() {