refactor: extensions::ViewType moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351
This commit is contained in:
Samuel Attard 2021-03-04 16:23:10 -08:00
parent c8148febfa
commit 87df2766ba
2 changed files with 5 additions and 5 deletions

View file

@ -591,7 +591,7 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
WebContents::Type GetTypeFromViewType(extensions::ViewType view_type) { WebContents::Type GetTypeFromViewType(extensions::mojom::ViewType view_type) {
switch (view_type) { switch (view_type) {
case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE:
return WebContents::Type::kBackgroundPage; return WebContents::Type::kBackgroundPage;
@ -625,7 +625,7 @@ WebContents::WebContents(v8::Isolate* isolate,
{ {
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
// WebContents created by extension host will have valid ViewType set. // WebContents created by extension host will have valid ViewType set.
extensions::ViewType view_type = extensions::GetViewType(web_contents); extensions::mojom::ViewType view_type = extensions::GetViewType(web_contents);
if (view_type != extensions::VIEW_TYPE_INVALID) { if (view_type != extensions::VIEW_TYPE_INVALID) {
InitWithExtensionView(isolate, web_contents, view_type); InitWithExtensionView(isolate, web_contents, view_type);
} }
@ -865,7 +865,7 @@ void WebContents::InitWithSessionAndOptions(
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
void WebContents::InitWithExtensionView(v8::Isolate* isolate, void WebContents::InitWithExtensionView(v8::Isolate* isolate,
content::WebContents* web_contents, content::WebContents* web_contents,
extensions::ViewType view_type) { extensions::mojom::ViewType view_type) {
// Must reassign type prior to calling `Init`. // Must reassign type prior to calling `Init`.
type_ = GetTypeFromViewType(view_type); type_ = GetTypeFromViewType(view_type);
if (GetType() == Type::kRemote) if (GetType() == Type::kRemote)

View file

@ -48,7 +48,7 @@
#endif #endif
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
#include "extensions/common/view_type.h" #include "extensions/common/mojom/view_type.mojom.h"
namespace extensions { namespace extensions {
class ScriptExecutor; class ScriptExecutor;
@ -453,7 +453,7 @@ class WebContents : public gin::Wrappable<WebContents>,
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
void InitWithExtensionView(v8::Isolate* isolate, void InitWithExtensionView(v8::Isolate* isolate,
content::WebContents* web_contents, content::WebContents* web_contents,
extensions::ViewType view_type); extensions::mojom::ViewType view_type);
#endif #endif
// content::WebContentsDelegate: // content::WebContentsDelegate: