OLD | NEW |
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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 public ViewObserver { | 196 public ViewObserver { |
197 public: | 197 public: |
198 MediaViewer() | 198 MediaViewer() |
199 : shell_(nullptr), | 199 : shell_(nullptr), |
200 app_(NULL), | 200 app_(NULL), |
201 view_manager_(NULL), | 201 view_manager_(NULL), |
202 root_view_(NULL), | 202 root_view_(NULL), |
203 control_view_(NULL), | 203 control_view_(NULL), |
204 content_view_(NULL), | 204 content_view_(NULL), |
205 control_panel_(this) { | 205 control_panel_(this) { |
206 handler_map_["image/png"] = "mojo:mojo_png_viewer"; | 206 handler_map_["image/png"] = "mojo:png_viewer"; |
207 } | 207 } |
208 | 208 |
209 virtual ~MediaViewer() { | 209 virtual ~MediaViewer() { |
210 if (root_view_) | 210 if (root_view_) |
211 root_view_->RemoveObserver(this); | 211 root_view_->RemoveObserver(this); |
212 } | 212 } |
213 | 213 |
214 private: | 214 private: |
215 typedef std::map<std::string, std::string> HandlerMap; | 215 typedef std::map<std::string, std::string> HandlerMap; |
216 | 216 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 DISALLOW_COPY_AND_ASSIGN(MediaViewer); | 319 DISALLOW_COPY_AND_ASSIGN(MediaViewer); |
320 }; | 320 }; |
321 | 321 |
322 } // namespace examples | 322 } // namespace examples |
323 } // namespace mojo | 323 } // namespace mojo |
324 | 324 |
325 MojoResult MojoMain(MojoHandle shell_handle) { | 325 MojoResult MojoMain(MojoHandle shell_handle) { |
326 mojo::ApplicationRunnerChromium runner(new mojo::examples::MediaViewer); | 326 mojo::ApplicationRunnerChromium runner(new mojo::examples::MediaViewer); |
327 return runner.Run(shell_handle); | 327 return runner.Run(shell_handle); |
328 } | 328 } |
OLD | NEW |