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

Side by Side Diff: examples/pdf_viewer/pdf_viewer.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
« no previous file with comments | « examples/nfc_sender/nfc_sender.cc ('k') | examples/spinning_cube/gles2_client_impl.cc » ('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 <string> 5 #include <string>
6 6
7 #include "examples/bitmap_uploader/bitmap_uploader.h" 7 #include "examples/bitmap_uploader/bitmap_uploader.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/application/content_handler_factory.h" 9 #include "mojo/application/content_handler_factory.h"
10 #include "mojo/data_pipe_utils/data_pipe_utils.h" 10 #include "mojo/data_pipe_utils/data_pipe_utils.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 void OnViewBoundsChanged(View* view, 99 void OnViewBoundsChanged(View* view,
100 const Rect& old_bounds, 100 const Rect& old_bounds,
101 const Rect& new_bounds) override { 101 const Rect& new_bounds) override {
102 DCHECK(embedder_for_roots_.find(view) != embedder_for_roots_.end()); 102 DCHECK(embedder_for_roots_.find(view) != embedder_for_roots_.end());
103 DrawBitmap(embedder_for_roots_[view]); 103 DrawBitmap(embedder_for_roots_[view]);
104 } 104 }
105 105
106 void OnViewInputEvent(View* view, const EventPtr& event) override { 106 void OnViewInputEvent(View* view, const EventPtr& event) override {
107 DCHECK(embedder_for_roots_.find(view) != embedder_for_roots_.end()); 107 DCHECK(embedder_for_roots_.find(view) != embedder_for_roots_.end());
108 if (event->key_data && 108 if (event->key_data &&
109 (event->action != EVENT_TYPE_KEY_PRESSED || event->key_data->is_char)) { 109 (event->action != EventType::KEY_PRESSED || event->key_data->is_char)) {
110 return; 110 return;
111 } 111 }
112 if ((event->key_data && 112 if ((event->key_data &&
113 event->key_data->windows_key_code == KEYBOARD_CODE_DOWN) || 113 event->key_data->windows_key_code == KeyboardCode::DOWN) ||
114 (event->pointer_data && event->pointer_data->vertical_wheel < 0)) { 114 (event->pointer_data && event->pointer_data->vertical_wheel < 0)) {
115 if (current_page_ < (page_count_ - 1)) { 115 if (current_page_ < (page_count_ - 1)) {
116 current_page_++; 116 current_page_++;
117 DrawBitmap(embedder_for_roots_[view]); 117 DrawBitmap(embedder_for_roots_[view]);
118 } 118 }
119 } else if ((event->key_data && 119 } else if ((event->key_data &&
120 event->key_data->windows_key_code == KEYBOARD_CODE_UP) || 120 event->key_data->windows_key_code == KeyboardCode::UP) ||
121 (event->pointer_data && 121 (event->pointer_data &&
122 event->pointer_data->vertical_wheel > 0)) { 122 event->pointer_data->vertical_wheel > 0)) {
123 if (current_page_ > 0) { 123 if (current_page_ > 0) {
124 current_page_--; 124 current_page_--;
125 DrawBitmap(embedder_for_roots_[view]); 125 DrawBitmap(embedder_for_roots_[view]);
126 } 126 }
127 } 127 }
128 } 128 }
129 129
130 void OnViewDestroyed(View* view) override { 130 void OnViewDestroyed(View* view) override {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 DISALLOW_COPY_AND_ASSIGN(PDFViewer); 212 DISALLOW_COPY_AND_ASSIGN(PDFViewer);
213 }; 213 };
214 214
215 } // namespace examples 215 } // namespace examples
216 } // namespace mojo 216 } // namespace mojo
217 217
218 MojoResult MojoMain(MojoHandle application_request) { 218 MojoResult MojoMain(MojoHandle application_request) {
219 mojo::ApplicationRunnerChromium runner(new mojo::examples::PDFViewer()); 219 mojo::ApplicationRunnerChromium runner(new mojo::examples::PDFViewer());
220 return runner.Run(application_request); 220 return runner.Run(application_request);
221 } 221 }
OLDNEW
« no previous file with comments | « examples/nfc_sender/nfc_sender.cc ('k') | examples/spinning_cube/gles2_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698