Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / mojo / runner / android / ui_application_loader_android.h
blobbe2be155c2dab5d79565a167e9d4ad933cd3958b
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
3 // found in the LICENSE file.
5 #ifndef MOJO_RUNNER_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_
6 #define MOJO_RUNNER_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "mojo/shell/application_loader.h"
12 namespace base {
13 class MessageLoop;
16 namespace mojo {
17 namespace runner {
19 class ApplicationManager;
21 // ApplicationLoader implementation that creates a background thread and issues
22 // load
23 // requests there.
24 class UIApplicationLoader : public shell::ApplicationLoader {
25 public:
26 UIApplicationLoader(scoped_ptr<ApplicationLoader> real_loader,
27 base::MessageLoop* ui_message_loop);
28 ~UIApplicationLoader() override;
30 // ApplicationLoader overrides:
31 void Load(const GURL& url,
32 InterfaceRequest<Application> application_request) override;
34 private:
35 class UILoader;
37 // These functions are exected on the background thread. They call through
38 // to |background_loader_| to do the actual loading.
39 // TODO: having this code take a |manager| is fragile (as ApplicationManager
40 // isn't thread safe).
41 void LoadOnUIThread(const GURL& url,
42 InterfaceRequest<Application> application_request);
43 void ShutdownOnUIThread();
45 scoped_ptr<ApplicationLoader> loader_;
46 base::MessageLoop* ui_message_loop_;
48 DISALLOW_COPY_AND_ASSIGN(UIApplicationLoader);
51 } // namespace runner
52 } // namespace mojo
54 #endif // MOJO_RUNNER_ANDROID_UI_APPLICATION_LOADER_ANDROID_H_