From 7d6b6e9bae5f26dda876e4b5b465994fff7d3b5d Mon Sep 17 00:00:00 2001
From: Christophe Chapuis <chris.chapuis@gmail.com>
Date: Tue, 20 Oct 2015 20:33:24 +0200
Subject: [PATCH 04/10] Store the additional window features related to LuneOS
 in the WebContentsView object

 - additional_features (from window.open parameter)
 - initial target URL

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
---
 chromium/content/browser/web_contents/web_contents_impl.cc | 8 +++++++-
 chromium/content/browser/web_contents/web_contents_view.h  | 8 ++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/3rdparty/chromium/content/browser/web_contents/web_contents_impl.cc b/src/3rdparty/chromium/content/browser/web_contents/web_contents_impl.cc
index 5eed7db..228b62a 100644
--- a/src/3rdparty/chromium/content/browser/web_contents/web_contents_impl.cc
+++ b/src/3rdparty/chromium/content/browser/web_contents/web_contents_impl.cc
@@ -2136,6 +2136,11 @@ void WebContentsImpl::CreateNewWindow(
     if (!is_guest) {
       WebContentsView* new_view = new_contents->view_.get();
 
+      // set the additional features required by the LuneOS app
+      // (ideally this information should be propagated using the IPC messaging)
+      new_view->setWindowAdditionalFeatures(params.additional_features);
+      new_view->setInitialTargetURL(params.target_url);
+
       // TODO(brettw): It seems bogus that we have to call this function on the
       // newly created object and give it one of its own member variables.
       new_view->CreateViewForWidget(
@@ -2249,8 +2254,9 @@ void WebContentsImpl::ShowCreatedWindow(int process_id,
       contents->ResumeLoadingCreatedWebContents();
 
     if (delegate) {
+      std::vector<base::string16> additional_features = contents->view_.get()->getWindowAdditionalFeatures();
       delegate->AddNewContents(
-          this, contents, disposition, initial_rect, user_gesture, NULL);
+          this, contents, disposition, initial_rect, user_gesture, NULL, additional_features);
     }
   }
 }
diff --git a/src/3rdparty/chromium/content/browser/web_contents/web_contents_view.h b/src/3rdparty/chromium/content/browser/web_contents/web_contents_view.h
index e4401f8..aa2f791 100644
--- a/src/3rdparty/chromium/content/browser/web_contents/web_contents_view.h
+++ b/src/3rdparty/chromium/content/browser/web_contents/web_contents_view.h
@@ -13,6 +13,7 @@
 #include "ui/gfx/geometry/rect.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/native_widget_types.h"
+#include "url/gurl.h"
 
 namespace content {
 class RenderViewHost;
@@ -131,6 +132,13 @@ class WebContentsView {
   virtual bool IsEventTracking() const = 0;
   virtual void CloseTabAfterEventTracking() = 0;
 #endif
+
+  // Add accessors to set/get the window additional features wanted by the LuneOS apps
+  // The actual implementation is done in web_contents_view_qt.h
+  virtual void setWindowAdditionalFeatures(const std::vector<base::string16> &additional_features) {}
+  virtual std::vector<base::string16> getWindowAdditionalFeatures() {}
+  virtual void setInitialTargetURL(const GURL &initialURL) {}
+  virtual GURL getInitialTargetURL() {}
 };
 
 }  // namespace content
-- 
2.7.4

