From f65c5fc155c9f6c3f880389a57b7652614627654 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Fri, 19 Oct 2018 17:00:50 +0200
Subject: [PATCH] Cleanup web_contents_view_qt.h
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It had too many headers, and many files depending on its over inclusion.

Change-Id: I5add1c4e07a14e017ac60db75efab5fc11e4166f
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
---
 src/core/chromium_overrides.cpp               |  1 +
 src/core/javascript_dialog_manager_qt.cpp     |  2 ++
 src/core/login_delegate_qt.cpp                |  1 +
 src/core/media_capture_devices_dispatcher.cpp |  3 ++-
 src/core/net/network_delegate_qt.cpp          |  1 +
 src/core/permission_manager_qt.cpp            |  2 +-
 src/core/printing/print_view_manager_qt.cpp   |  4 +++-
 src/core/quota_permission_context_qt.cpp      |  2 +-
 src/core/web_contents_adapter.cpp             |  1 +
 src/core/web_contents_view_qt.cpp             |  3 +++
 src/core/web_contents_view_qt.h               | 20 +++++++++----------
 11 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp
index f3b7d3897..a497ddc46 100644
--- a/src/core/chromium_overrides.cpp
+++ b/src/core/chromium_overrides.cpp
@@ -46,6 +46,7 @@
 #include "base/values.h"
 #include "content/browser/renderer_host/pepper/pepper_truetype_font_list.h"
 #include "content/browser/renderer_host/render_widget_host_view_base.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/common/font_list.h"
 #include "ui/base/dragdrop/os_exchange_data.h"
 #include "ui/base/dragdrop/os_exchange_data_provider_factory.h"
diff --git a/src/core/javascript_dialog_manager_qt.cpp b/src/core/javascript_dialog_manager_qt.cpp
index 7f43f9020..289947237 100644
--- a/src/core/javascript_dialog_manager_qt.cpp
+++ b/src/core/javascript_dialog_manager_qt.cpp
@@ -44,7 +44,9 @@
 #include "web_contents_view_qt.h"
 #include "type_conversion.h"
 
+
 #include "base/memory/singleton.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 
 namespace QtWebEngineCore {
 
diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp
index 6dd2aa5ed..2dbc27cf2 100644
--- a/src/core/login_delegate_qt.cpp
+++ b/src/core/login_delegate_qt.cpp
@@ -43,6 +43,7 @@
 
 #include "login_delegate_qt.h"
 
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/resource_dispatcher_host.h"
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 59c3544a7..2bac62084 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -50,13 +50,14 @@
 
 #include "base/strings/utf_string_conversions.h"
 #include "chrome/browser/media/webrtc/desktop_streams_registry.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/desktop_media_id.h"
 #include "content/public/browser/media_capture_devices.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/notification_source.h"
 #include "content/public/browser/notification_types.h"
-#include "content/public/browser/web_contents.h"
+#include "content/public/browser/render_process_host.h"
 #include "content/public/common/origin_util.h"
 #include "content/public/common/media_stream_request.h"
 #include "media/audio/audio_device_description.h"
diff --git a/src/core/net/network_delegate_qt.cpp b/src/core/net/network_delegate_qt.cpp
index ccc8cc0e5..551302291 100644
--- a/src/core/net/network_delegate_qt.cpp
+++ b/src/core/net/network_delegate_qt.cpp
@@ -40,6 +40,7 @@
 #include "network_delegate_qt.h"
 
 #include "profile_adapter.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/resource_request_info.h"
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index 996a83d12..2fa42bf10 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -40,11 +40,11 @@
 #include "permission_manager_qt.h"
 
 #include "content/browser/renderer_host/render_view_host_delegate.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/permission_controller.h"
 #include "content/public/browser/permission_type.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
 
 #include "type_conversion.h"
 #include "web_contents_delegate_qt.h"
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 6813d54ee..ff9fc76be 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -44,8 +44,9 @@
 #include "print_view_manager_qt.h"
 
 #include "type_conversion.h"
-#include "web_engine_context.h"
+#include "web_contents_adapter_client.h"
 #include "web_contents_view_qt.h"
+#include "web_engine_context.h"
 
 #include <QtGui/qpagelayout.h>
 #include <QtGui/qpagesize.h>
@@ -57,6 +58,7 @@
 #include "chrome/browser/printing/printer_query.h"
 #include "components/printing/common/print_messages.h"
 #include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/common/web_preferences.h"
diff --git a/src/core/quota_permission_context_qt.cpp b/src/core/quota_permission_context_qt.cpp
index f00b2008a..cb1467364 100644
--- a/src/core/quota_permission_context_qt.cpp
+++ b/src/core/quota_permission_context_qt.cpp
@@ -39,9 +39,9 @@
 
 #include "quota_permission_context_qt.h"
 
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_frame_host.h"
-#include "content/public/browser/web_contents.h"
 #include "quota_request_controller_impl.h"
 #include "qwebenginequotarequest.h"
 #include "web_contents_delegate_qt.h"
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index cac5bd09e..762d9f53a 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -55,6 +55,7 @@
 #include "profile_qt.h"
 #include "qwebenginecallback_p.h"
 #include "render_view_observer_host_qt.h"
+#include "render_widget_host_view_qt.h"
 #include "type_conversion.h"
 #include "web_contents_view_qt.h"
 #include "web_engine_context.h"
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index f1d795ed7..7910688d3 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -42,12 +42,15 @@
 #include "profile_adapter.h"
 #include "content_browser_client_qt.h"
 #include "render_widget_host_view_qt_delegate.h"
+#include "render_widget_host_view_qt.h"
 #include "type_conversion.h"
 #include "web_contents_adapter.h"
 #include "web_engine_context.h"
 
 #include "components/spellcheck/spellcheck_buildflags.h"
 #include "content/browser/renderer_host/render_view_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/common/context_menu_params.h"
 #include <ui/gfx/image/image_skia.h>
 
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index 2dd94eabb..d1a2ff81e 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -41,16 +41,16 @@
 #define WEB_CONTENTS_VIEW_QT_H
 
 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
-#include "content/browser/web_contents/web_contents_impl.h"
 #include "content/browser/web_contents/web_contents_view.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/render_widget_host.h"
-#include "render_widget_host_view_qt.h"
-#include "web_contents_adapter_client.h"
-#include "web_contents_delegate_qt.h"
-#include "web_engine_context.h"
+
+#include "api/qtwebenginecoreglobal_p.h"
+
+namespace content {
+class WebContents;
+}
 
 namespace QtWebEngineCore {
+class WebContentsAdapterClient;
 
 class WebContentsViewQt
     : public content::WebContentsView
@@ -61,8 +61,8 @@ public:
 
     WebContentsViewQt(content::WebContents* webContents)
         : m_webContents(webContents)
-        , m_client(0)
-        , m_factoryClient(0)
+        , m_client(nullptr)
+        , m_factoryClient(nullptr)
         , m_allowOtherViews(false)
     { }
 
@@ -103,7 +103,7 @@ public:
 
     void RestoreFocus() override { QT_NOT_USED }
 
-    content::DropData* GetDropData() const override { QT_NOT_YET_IMPLEMENTED return 0; }
+    content::DropData* GetDropData() const override { QT_NOT_YET_IMPLEMENTED return nullptr; }
 
     gfx::Rect GetViewBounds() const override { QT_NOT_YET_IMPLEMENTED return gfx::Rect(); }
 
-- 
GitLab