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

Side by Side Diff: mojo/examples/nesting_app/nesting_app.cc

Issue 413633003: Mojo: Introduces mojo::EventType and mojo::EventFlags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « mojo/examples/embedded_app/embedded_app.cc ('k') | mojo/examples/sample_app/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "mojo/examples/window_manager/window_manager.mojom.h" 9 #include "mojo/examples/window_manager/window_manager.mojom.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 nested_->Embed(kEmbeddedAppURL); 94 nested_->Embed(kEmbeddedAppURL);
95 95
96 NavigateChild(); 96 NavigateChild();
97 } 97 }
98 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { 98 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE {
99 base::MessageLoop::current()->Quit(); 99 base::MessageLoop::current()->Quit();
100 } 100 }
101 101
102 // Overridden from ViewObserver: 102 // Overridden from ViewObserver:
103 virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE { 103 virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE {
104 if (event->action == ui::ET_MOUSE_RELEASED) 104 if (event->action == EVENT_TYPE_MOUSE_RELEASED)
105 window_manager_->CloseWindow(view->node()->id()); 105 window_manager_->CloseWindow(view->node()->id());
106 } 106 }
107 107
108 // Overridden from NodeObserver: 108 // Overridden from NodeObserver:
109 virtual void OnNodeDestroyed(Node* node) OVERRIDE { 109 virtual void OnNodeDestroyed(Node* node) OVERRIDE {
110 // TODO(beng): reap views & child nodes. 110 // TODO(beng): reap views & child nodes.
111 nested_ = NULL; 111 nested_ = NULL;
112 } 112 }
113 113
114 void NavigateChild() { 114 void NavigateChild() {
(...skipping 19 matching lines...) Expand all
134 }; 134 };
135 135
136 } // namespace examples 136 } // namespace examples
137 137
138 // static 138 // static
139 ApplicationDelegate* ApplicationDelegate::Create() { 139 ApplicationDelegate* ApplicationDelegate::Create() {
140 return new examples::NestingApp; 140 return new examples::NestingApp;
141 } 141 }
142 142
143 } // namespace mojo 143 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/embedded_app/embedded_app.cc ('k') | mojo/examples/sample_app/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698