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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Register Blimp prefs. The implementation of this function depends on | 60 // Register Blimp prefs. The implementation of this function depends on |
61 // whether the core or dummy implementation of Blimp has been linked in. | 61 // whether the core or dummy implementation of Blimp has been linked in. |
62 static void RegisterPrefs(PrefRegistrySimple* registry); | 62 static void RegisterPrefs(PrefRegistrySimple* registry); |
63 | 63 |
64 // Apply blimp command-line switches to the corresponding preferences of the | 64 // Apply blimp command-line switches to the corresponding preferences of the |
65 // blimp's own switch map. | 65 // blimp's own switch map. |
66 static void ApplyBlimpSwitches(CommandLinePrefStore* store); | 66 static void ApplyBlimpSwitches(CommandLinePrefStore* store); |
67 | 67 |
68 // The delegate provides all the required functionality from the embedder. | 68 // The delegate provides all the required functionality from the embedder. |
| 69 // The context must be initialized with a |delegate| before it can be used. |
69 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0; | 70 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0; |
70 | 71 |
71 // Creates a new BlimpContents that will be shown in |window|. | 72 // Creates a new BlimpContents that will be shown in |window|. |
72 // TODO(mlliu): Currently we want to have a single BlimpContents. If there is | 73 // TODO(mlliu): Currently we want to have a single BlimpContents. If there is |
73 // an existing contents, return nullptr (http://crbug.com/642558). | 74 // an existing contents, return nullptr (http://crbug.com/642558). |
74 virtual std::unique_ptr<BlimpContents> CreateBlimpContents( | 75 virtual std::unique_ptr<BlimpContents> CreateBlimpContents( |
75 gfx::NativeWindow window) = 0; | 76 gfx::NativeWindow window) = 0; |
76 | 77 |
77 // Start authentication flow and connection to engine. | 78 // Start authentication flow and connection to engine. |
78 virtual void Connect() = 0; | 79 virtual void Connect() = 0; |
79 virtual void ConnectWithAssignment(const Assignment& assignment) = 0; | 80 virtual void ConnectWithAssignment(const Assignment& assignment) = 0; |
80 | 81 |
81 protected: | 82 protected: |
82 BlimpClientContext() = default; | 83 BlimpClientContext() = default; |
83 | 84 |
84 private: | 85 private: |
85 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext); | 86 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext); |
86 }; | 87 }; |
87 | 88 |
88 } // namespace client | 89 } // namespace client |
89 } // namespace blimp | 90 } // namespace blimp |
90 | 91 |
91 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ | 92 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_ |
OLD | NEW |