| 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 #ifndef MOJO_SHELL_STANDALONE_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_ | 5 #ifndef MOJO_SHELL_STANDALONE_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_ |
| 6 #define MOJO_SHELL_STANDALONE_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_ | 6 #define MOJO_SHELL_STANDALONE_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_ |
| 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 "mojo/shell/application_loader.h" | 10 #include "mojo/shell/application_loader.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // load | 22 // load |
| 23 // requests there. | 23 // requests there. |
| 24 class UIApplicationLoader : public ApplicationLoader { | 24 class UIApplicationLoader : public ApplicationLoader { |
| 25 public: | 25 public: |
| 26 UIApplicationLoader(scoped_ptr<ApplicationLoader> real_loader, | 26 UIApplicationLoader(scoped_ptr<ApplicationLoader> real_loader, |
| 27 base::MessageLoop* ui_message_loop); | 27 base::MessageLoop* ui_message_loop); |
| 28 ~UIApplicationLoader() override; | 28 ~UIApplicationLoader() override; |
| 29 | 29 |
| 30 // ApplicationLoader overrides: | 30 // ApplicationLoader overrides: |
| 31 void Load(const GURL& url, | 31 void Load(const GURL& url, |
| 32 InterfaceRequest<mojom::Application> application_request) override; | 32 InterfaceRequest<mojom::ShellClient> request) override; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 class UILoader; | 35 class UILoader; |
| 36 | 36 |
| 37 // These functions are exected on the background thread. They call through | 37 // These functions are exected on the background thread. They call through |
| 38 // to |background_loader_| to do the actual loading. | 38 // to |background_loader_| to do the actual loading. |
| 39 // TODO: having this code take a |manager| is fragile (as ApplicationManager | 39 // TODO: having this code take a |manager| is fragile (as ApplicationManager |
| 40 // isn't thread safe). | 40 // isn't thread safe). |
| 41 void LoadOnUIThread(const GURL& url, | 41 void LoadOnUIThread(const GURL& url, |
| 42 InterfaceRequest<mojom::Application> application_request); | 42 InterfaceRequest<mojom::ShellClient> request); |
| 43 void ShutdownOnUIThread(); | 43 void ShutdownOnUIThread(); |
| 44 | 44 |
| 45 scoped_ptr<ApplicationLoader> loader_; | 45 scoped_ptr<ApplicationLoader> loader_; |
| 46 base::MessageLoop* ui_message_loop_; | 46 base::MessageLoop* ui_message_loop_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(UIApplicationLoader); | 48 DISALLOW_COPY_AND_ASSIGN(UIApplicationLoader); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace shell | 51 } // namespace shell |
| 52 } // namespace mojo | 52 } // namespace mojo |
| 53 | 53 |
| 54 #endif // MOJO_SHELL_STANDALONE_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_ | 54 #endif // MOJO_SHELL_STANDALONE_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_ |
| OLD | NEW |