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

Unified Diff: sky/shell/ui/engine.cc

Issue 945083002: Fix display of fonts in SkyShell (Closed) Base URL: git@github.com:abarth/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/ui/engine.cc
diff --git a/sky/shell/ui/engine.cc b/sky/shell/ui/engine.cc
index c1fb1dc51da4d3abd3a486c6256e240fa52892cd..ef633c071f366c26efedf0a4001e5c28191e35bc 100644
--- a/sky/shell/ui/engine.cc
+++ b/sky/shell/ui/engine.cc
@@ -8,6 +8,7 @@
#include "sky/engine/public/platform/WebInputEvent.h"
#include "sky/engine/public/web/Sky.h"
#include "sky/engine/public/web/WebLocalFrame.h"
+#include "sky/engine/public/web/WebSettings.h"
#include "sky/engine/public/web/WebView.h"
#include "sky/shell/ui/animator.h"
#include "sky/shell/ui/input_event_converter.h"
@@ -18,6 +19,12 @@
namespace sky {
namespace shell {
+void ConfigureSettings(blink::WebSettings* settings) {
abarth-chromium 2015/02/20 22:54:11 Can you wrap this in an anonymous namespace or mar
+ settings->setDefaultFixedFontSize(13);
+ settings->setDefaultFontSize(16);
+ settings->setLoadsImagesAutomatically(true);
+}
+
Engine::Engine(const Config& config)
: animator_(new Animator(config, this)),
web_view_(nullptr),
@@ -85,6 +92,15 @@ void Engine::UpdateWebViewSize()
web_view_->resize(blink::WebSize(size.width(), size.height()));
}
+// TODO(eseidel): This is likely not needed anymore.
+blink::WebScreenInfo Engine::screenInfo() {
+ blink::WebScreenInfo screen;
+ screen.rect = blink::WebRect(gfx::Rect(physical_size_));
+ screen.availableRect = screen.rect;
+ screen.deviceScaleFactor = device_pixel_ratio_;
+ return screen;
+}
+
void Engine::OnInputEvent(InputEventPtr event) {
scoped_ptr<blink::WebInputEvent> web_event =
ConvertEvent(event, device_pixel_ratio_);
@@ -95,6 +111,7 @@ void Engine::OnInputEvent(InputEventPtr event) {
void Engine::LoadURL(const mojo::String& url) {
web_view_ = blink::WebView::create(this);
+ ConfigureSettings(web_view_->settings());
web_view_->setMainFrame(blink::WebLocalFrame::create(this));
UpdateWebViewSize();
web_view_->mainFrame()->load(GURL(url));
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698