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