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

Unified Diff: services/native_viewport/native_viewport_impl.cc

Issue 1280613003: Allow native_viewport to create new native windows on demand on Android. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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: services/native_viewport/native_viewport_impl.cc
diff --git a/services/native_viewport/native_viewport_impl.cc b/services/native_viewport/native_viewport_impl.cc
index 1fcb20f701312e71437af1a1c8bfb199877c0ec0..ce258332a8acf7acecf63e12da964b1bd735fb9a 100644
--- a/services/native_viewport/native_viewport_impl.cc
+++ b/services/native_viewport/native_viewport_impl.cc
@@ -11,6 +11,7 @@
#include "base/time/time.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/converters/native_viewport/surface_configuration_type_converters.h"
+#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/interface_factory.h"
#include "services/gles2/gpu_state.h"
#include "services/native_viewport/platform_viewport_headless.h"
@@ -20,16 +21,17 @@
namespace native_viewport {
NativeViewportImpl::NativeViewportImpl(
+ mojo::ApplicationImpl* application,
bool is_headless,
const scoped_refptr<gles2::GpuState>& gpu_state,
mojo::InterfaceRequest<mojo::NativeViewport> request)
- : is_headless_(is_headless),
+ : application_(application),
+ is_headless_(is_headless),
context_provider_(gpu_state),
sent_metrics_(false),
metrics_(mojo::ViewportMetrics::New()),
binding_(this, request.Pass()),
- weak_factory_(this) {
-}
+ weak_factory_(this) {}
NativeViewportImpl::~NativeViewportImpl() {
// Destroy the NativeViewport early on as it may call us back during
@@ -51,7 +53,7 @@ void NativeViewportImpl::Create(
if (is_headless_)
platform_viewport_ = PlatformViewportHeadless::Create(this);
else
- platform_viewport_ = PlatformViewport::Create(this);
+ platform_viewport_ = PlatformViewport::Create(application_, this);
platform_viewport_->Init(gfx::Rect(size.To<gfx::Size>()));
}
« no previous file with comments | « services/native_viewport/native_viewport_impl.h ('k') | services/native_viewport/native_viewport_internal.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698