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

Unified Diff: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp

Issue 2848513002: Introduce the abstract class WebViewBase, to decouple WebViewImpl. (Closed)
Patch Set: Fix typo. Created 3 years, 8 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: third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
diff --git a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
index 0701c536186e1150d50181c150b94e6eb1a6126b..3dde0059e1c509331750bcb0e42dcf0a61d74979 100644
--- a/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
+++ b/third_party/WebKit/Source/web/InspectorEmulationAgent.cpp
@@ -4,6 +4,7 @@
#include "web/InspectorEmulationAgent.h"
+#include "core/exported/WebViewBase.h"
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
#include "core/inspector/protocol/DOM.h"
@@ -16,7 +17,6 @@
#include "public/platform/WebThread.h"
#include "web/DevToolsEmulator.h"
#include "web/WebLocalFrameImpl.h"
-#include "web/WebViewImpl.h"
namespace blink {
@@ -48,7 +48,7 @@ InspectorEmulationAgent::InspectorEmulationAgent(
InspectorEmulationAgent::~InspectorEmulationAgent() {}
-WebViewImpl* InspectorEmulationAgent::GetWebViewImpl() {
+WebViewBase* InspectorEmulationAgent::GetWebViewBase() {
return web_local_frame_impl_->ViewImpl();
}
@@ -106,30 +106,30 @@ Response InspectorEmulationAgent::forceViewport(double x,
state_->setDouble(EmulationAgentState::kForcedViewportY, y);
state_->setDouble(EmulationAgentState::kForcedViewportScale, scale);
- GetWebViewImpl()->GetDevToolsEmulator()->ForceViewport(WebFloatPoint(x, y),
+ GetWebViewBase()->GetDevToolsEmulator()->ForceViewport(WebFloatPoint(x, y),
scale);
return Response::OK();
}
Response InspectorEmulationAgent::resetViewport() {
state_->setBoolean(EmulationAgentState::kForcedViewportEnabled, false);
- GetWebViewImpl()->GetDevToolsEmulator()->ResetViewport();
+ GetWebViewBase()->GetDevToolsEmulator()->ResetViewport();
return Response::OK();
}
Response InspectorEmulationAgent::resetPageScaleFactor() {
- GetWebViewImpl()->ResetScaleStateImmediately();
+ GetWebViewBase()->ResetScaleStateImmediately();
return Response::OK();
}
Response InspectorEmulationAgent::setPageScaleFactor(double page_scale_factor) {
- GetWebViewImpl()->SetPageScaleFactor(static_cast<float>(page_scale_factor));
+ GetWebViewBase()->SetPageScaleFactor(static_cast<float>(page_scale_factor));
return Response::OK();
}
Response InspectorEmulationAgent::setScriptExecutionDisabled(bool value) {
state_->setBoolean(EmulationAgentState::kScriptExecutionDisabled, value);
- GetWebViewImpl()->GetDevToolsEmulator()->SetScriptExecutionDisabled(value);
+ GetWebViewBase()->GetDevToolsEmulator()->SetScriptExecutionDisabled(value);
return Response::OK();
}
@@ -137,14 +137,14 @@ Response InspectorEmulationAgent::setTouchEmulationEnabled(
bool enabled,
Maybe<String> configuration) {
state_->setBoolean(EmulationAgentState::kTouchEventEmulationEnabled, enabled);
- GetWebViewImpl()->GetDevToolsEmulator()->SetTouchEventEmulationEnabled(
+ GetWebViewBase()->GetDevToolsEmulator()->SetTouchEventEmulationEnabled(
enabled);
return Response::OK();
}
Response InspectorEmulationAgent::setEmulatedMedia(const String& media) {
state_->setString(EmulationAgentState::kEmulatedMedia, media);
- GetWebViewImpl()->GetPage()->GetSettings().SetMediaTypeOverride(media);
+ GetWebViewBase()->GetPage()->GetSettings().SetMediaTypeOverride(media);
return Response::OK();
}
@@ -192,7 +192,7 @@ Response InspectorEmulationAgent::setDefaultBackgroundColorOverride(
Maybe<protocol::DOM::RGBA> color) {
if (!color.isJust()) {
// Clear the override and state.
- GetWebViewImpl()->ClearBaseBackgroundColorOverride();
+ GetWebViewBase()->ClearBaseBackgroundColorOverride();
state_->remove(EmulationAgentState::kDefaultBackgroundColorOverrideRGBA);
return Response::OK();
}
@@ -202,7 +202,7 @@ Response InspectorEmulationAgent::setDefaultBackgroundColorOverride(
rgba->toValue());
// Clamping of values is done by Color() constructor.
int alpha = lroundf(255.0f * rgba->getA(1.0f));
- GetWebViewImpl()->SetBaseBackgroundColorOverride(
+ GetWebViewBase()->SetBaseBackgroundColorOverride(
Color(rgba->getR(), rgba->getG(), rgba->getB(), alpha).Rgb());
return Response::OK();
}
« no previous file with comments | « third_party/WebKit/Source/web/InspectorEmulationAgent.h ('k') | third_party/WebKit/Source/web/InspectorOverlayAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698