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

Unified Diff: components/html_viewer/global_state.cc

Issue 1407073002: Adds GetDisplays() to WindowManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 2 trunk Created 5 years, 2 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 | « no previous file | components/html_viewer/run_all_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/html_viewer/global_state.cc
diff --git a/components/html_viewer/global_state.cc b/components/html_viewer/global_state.cc
index e9c295ff11047625c60a7636e5b4a1ad32937f0a..fa3eb70569db302ca3d2a57f9c97d71dd026c7fa 100644
--- a/components/html_viewer/global_state.cc
+++ b/components/html_viewer/global_state.cc
@@ -20,6 +20,7 @@
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "ui/gfx/display.h"
#include "ui/mojo/init/ui_init.h"
#include "v8/include/v8.h"
@@ -56,16 +57,26 @@ std::set<std::string> GetResourcePaths() {
return paths;
}
+// TODO(sky): convert to using DisplayService.
+std::vector<gfx::Display> DisplaysFromSizeAndScale(
+ const gfx::Size& screen_size_in_pixels,
+ float device_pixel_ratio) {
+ std::vector<gfx::Display> displays(1);
+ displays[0].set_id(2000);
+ displays[0].SetScaleAndBounds(device_pixel_ratio,
+ gfx::Rect(screen_size_in_pixels));
+ return displays;
+}
+
} // namespace
GlobalState::GlobalState(mojo::ApplicationImpl* app)
: app_(app),
- resource_loader_(app->shell(), GetResourcePaths()),
+ resource_loader_(app, GetResourcePaths()),
did_init_(false),
device_pixel_ratio_(1.f),
discardable_memory_allocator_(kDesiredMaxMemory),
- compositor_thread_("compositor thread") {
-}
+ compositor_thread_("compositor thread") {}
GlobalState::~GlobalState() {
if (blink_platform_) {
@@ -105,8 +116,8 @@ void GlobalState::InitIfNecessary(const gfx::Size& screen_size_in_pixels,
SkFontConfigInterface::SetGlobal(font_loader_.get());
#endif
- ui_init_.reset(
- new ui::mojo::UIInit(screen_size_in_pixels, device_pixel_ratio));
+ ui_init_.reset(new ui::mojo::UIInit(
+ DisplaysFromSizeAndScale(screen_size_in_pixels_, device_pixel_ratio_)));
base::DiscardableMemoryAllocator::SetInstance(&discardable_memory_allocator_);
mojo::URLRequestPtr request(mojo::URLRequest::New());
« no previous file with comments | « no previous file | components/html_viewer/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698