| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 5 #ifndef BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
| 6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "blimp/client/public/blimp_client_context_delegate.h" | 13 #include "blimp/client/public/blimp_client_context_delegate.h" |
| 14 #include "blimp/client/public/contents/blimp_contents.h" | 14 #include "blimp/client/public/contents/blimp_contents.h" |
| 15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 16 #include "components/prefs/pref_registry_simple.h" |
| 17 #include "components/prefs/pref_service.h" |
| 16 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
| 17 | 19 |
| 18 #if defined(OS_ANDROID) | 20 #if defined(OS_ANDROID) |
| 19 #include "base/android/jni_android.h" | 21 #include "base/android/jni_android.h" |
| 20 #endif // defined(OS_ANDROID) | 22 #endif // defined(OS_ANDROID) |
| 21 | 23 |
| 22 namespace base { | 24 namespace base { |
| 23 class SupportsUserData; | 25 class SupportsUserData; |
| 24 } | 26 } |
| 25 | 27 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 44 // linked in. | 46 // linked in. |
| 45 // The |io_thread_task_runner| must be the task runner to use for IO | 47 // The |io_thread_task_runner| must be the task runner to use for IO |
| 46 // operations. | 48 // operations. |
| 47 // The |file_thread_task_runner| must be the task runner to use for file | 49 // The |file_thread_task_runner| must be the task runner to use for file |
| 48 // operations. | 50 // operations. |
| 49 // |compositor_dependencies| is a support object that provides all embedder | 51 // |compositor_dependencies| is a support object that provides all embedder |
| 50 // dependencies required by internal compositors. | 52 // dependencies required by internal compositors. |
| 51 static BlimpClientContext* Create( | 53 static BlimpClientContext* Create( |
| 52 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, | 54 scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner, |
| 53 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, | 55 scoped_refptr<base::SingleThreadTaskRunner> file_thread_task_runner, |
| 54 std::unique_ptr<CompositorDependencies> compositor_dependencies); | 56 std::unique_ptr<CompositorDependencies> compositor_dependencies, |
| 57 PrefService* local_state); |
| 58 |
| 59 // Register Blimp prefs. The implementation of this function depends on |
| 60 // whether the core or dummy implementation of Blimp has been linked in. |
| 61 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 55 | 62 |
| 56 // The delegate provides all the required functionality from the embedder. | 63 // The delegate provides all the required functionality from the embedder. |
| 57 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0; | 64 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0; |
| 58 | 65 |
| 59 // Creates a new BlimpContents that will be shown in |window|. | 66 // Creates a new BlimpContents that will be shown in |window|. |
| 60 // TODO(mlliu): Currently we want to have a single BlimpContents. If there is | 67 // TODO(mlliu): Currently we want to have a single BlimpContents. If there is |
| 61 // an existing contents, return nullptr (http://crbug.com/642558). | 68 // an existing contents, return nullptr (http://crbug.com/642558). |
| 62 virtual std::unique_ptr<BlimpContents> CreateBlimpContents( | 69 virtual std::unique_ptr<BlimpContents> CreateBlimpContents( |
| 63 gfx::NativeWindow window) = 0; | 70 gfx::NativeWindow window) = 0; |
| 64 | 71 |
| 65 // Start authentication flow and connection to engine. | 72 // Start authentication flow and connection to engine. |
| 66 virtual void Connect() = 0; | 73 virtual void Connect() = 0; |
| 67 virtual void ConnectWithAssignment(const Assignment& assignment) = 0; | 74 virtual void ConnectWithAssignment(const Assignment& assignment) = 0; |
| 68 | 75 |
| 69 protected: | 76 protected: |
| 70 BlimpClientContext() = default; | 77 BlimpClientContext() = default; |
| 71 | 78 |
| 72 private: | 79 private: |
| 73 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext); | 80 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext); |
| 74 }; | 81 }; |
| 75 | 82 |
| 76 } // namespace client | 83 } // namespace client |
| 77 } // namespace blimp | 84 } // namespace blimp |
| 78 | 85 |
| 79 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 86 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
| OLD | NEW |