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

Unified Diff: services/native_viewport/main.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/main.cc
diff --git a/services/native_viewport/main.cc b/services/native_viewport/main.cc
index 368a347c74cb7ddfaa35121b24fdfc748815a894..2e8dd7ad33bfc30382ad18eb736347e0c01efca1 100644
--- a/services/native_viewport/main.cc
+++ b/services/native_viewport/main.cc
@@ -36,6 +36,7 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
private:
// mojo::ApplicationDelegate implementation.
void Initialize(mojo::ApplicationImpl* application) override {
+ application_ = application;
tracing_.Initialize(application);
// Apply the switch for kTouchEvents to CommandLine (if set). This allows
@@ -44,8 +45,7 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
const std::string touch_event_string("--" +
std::string(switches::kTouchDevices));
auto touch_iter = std::find(application->args().begin(),
- application->args().end(),
- touch_event_string);
+ application->args().end(), touch_event_string);
if (touch_iter != application->args().end() &&
++touch_iter != application->args().end()) {
command_line->AppendSwitchASCII(touch_event_string, *touch_iter);
@@ -72,7 +72,8 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
mojo::InterfaceRequest<NativeViewport> request) override {
if (!gpu_state_.get())
gpu_state_ = new gles2::GpuState;
- new NativeViewportImpl(is_headless_, gpu_state_, request.Pass());
+ new NativeViewportImpl(application_, is_headless_, gpu_state_,
+ request.Pass());
}
// mojo::InterfaceFactory<Gpu> implementation.
@@ -83,6 +84,7 @@ class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
new gles2::GpuImpl(request.Pass(), gpu_state_);
}
+ mojo::ApplicationImpl* application_;
scoped_refptr<gles2::GpuState> gpu_state_;
bool is_headless_;
mojo::TracingImpl tracing_;

Powered by Google App Engine
This is Rietveld 408576698