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

Side by Side Diff: examples/wm_flow/wm/wm.cc

Issue 1375313006: For c++, Generate enum classes instead of enum from mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
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 "examples/wm_flow/wm/frame_controller.h" 5 #include "examples/wm_flow/wm/frame_controller.h"
6 #include "mojo/application/application_runner_chromium.h" 6 #include "mojo/application/application_runner_chromium.h"
7 #include "mojo/public/c/system/main.h" 7 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_delegate.h" 8 #include "mojo/public/cpp/application/application_delegate.h"
9 #include "mojo/public/cpp/application/application_impl.h" 9 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/service_provider_impl.h" 10 #include "mojo/public/cpp/application/service_provider_impl.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 mojo::ServiceProviderPtr exposed_services) override { 62 mojo::ServiceProviderPtr exposed_services) override {
63 DCHECK(root_); 63 DCHECK(root_);
64 mojo::View* app_view = NULL; 64 mojo::View* app_view = NULL;
65 CreateTopLevelWindow(&app_view); 65 CreateTopLevelWindow(&app_view);
66 app_view->Embed(url, services.Pass(), exposed_services.Pass()); 66 app_view->Embed(url, services.Pass(), exposed_services.Pass());
67 } 67 }
68 68
69 // Overridden from mojo::ViewObserver: 69 // Overridden from mojo::ViewObserver:
70 void OnViewInputEvent(mojo::View* view, 70 void OnViewInputEvent(mojo::View* view,
71 const mojo::EventPtr& event) override { 71 const mojo::EventPtr& event) override {
72 if (event->action == mojo::EVENT_TYPE_POINTER_UP && 72 if (event->action == mojo::EventType::POINTER_UP &&
73 event->flags & mojo::EVENT_FLAGS_RIGHT_MOUSE_BUTTON && 73 event->flags & mojo::EventFlags::RIGHT_MOUSE_BUTTON &&
74 view->parent() == window_container_) { 74 view->parent() == window_container_) {
75 CloseWindow(view); 75 CloseWindow(view);
76 } 76 }
77 } 77 }
78 void OnViewDestroyed(mojo::View* view) override { 78 void OnViewDestroyed(mojo::View* view) override {
79 view->RemoveObserver(this); 79 view->RemoveObserver(this);
80 } 80 }
81 81
82 void CloseWindow(mojo::View* view) { 82 void CloseWindow(mojo::View* view) {
83 mojo::View* first_child = view->children().front(); 83 mojo::View* first_child = view->children().front();
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 DISALLOW_COPY_AND_ASSIGN(SimpleWM); 151 DISALLOW_COPY_AND_ASSIGN(SimpleWM);
152 }; 152 };
153 153
154 } // namespace examples 154 } // namespace examples
155 155
156 MojoResult MojoMain(MojoHandle application_request) { 156 MojoResult MojoMain(MojoHandle application_request) {
157 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM); 157 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM);
158 return runner.Run(application_request); 158 return runner.Run(application_request);
159 } 159 }
OLDNEW
« no previous file with comments | « examples/wm_flow/app/app.cc ('k') | mojo/converters/input_events/input_events_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698