Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: blimp/client/public/blimp_client_context.h

Issue 2132163002: Add BlimpClientContext and factory with real and dummy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-blimp-client-core-public-to-blimp-client
Patch Set: git merge origin/master before CQ for good measure Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_
6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_
7
8 #include <memory>
9
10 #include "blimp/client/public/blimp_client_context_delegate.h"
11 #include "blimp/client/public/blimp_contents.h"
12 #include "components/keyed_service/core/keyed_service.h"
13
14 #if defined(OS_ANDROID)
15 #include "base/android/jni_android.h"
16 #endif // defined(OS_ANDROID)
17
18 namespace base {
19 class SupportsUserData;
20 }
21
22 namespace blimp {
23 namespace client {
24
25 // BlimpClientContext is the core class for the Blimp client. It provides hooks
26 // for creating BlimpContents and other features that are per
27 // BrowserContext/Profile.
28 class BlimpClientContext : public KeyedService {
29 public:
30 #if defined(OS_ANDROID)
31 // Returns a Java object of the type BlimpClientContext.
32 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0;
33 #endif // defined(OS_ANDROID)
34
35 // Creates a BlimpClientContext. The implementation of this function
36 // depends on whether the core or dummy implementation of Blimp has been
37 // linked in.
38 static BlimpClientContext* Create();
39
40 // The delegate provides all the required functionality from the embedder.
41 virtual void SetDelegate(BlimpClientContextDelegate* delegate) = 0;
42
43 // Creates a new BlimpContents.
44 virtual std::unique_ptr<BlimpContents> CreateBlimpContents() = 0;
45
46 protected:
47 BlimpClientContext() = default;
48
49 private:
50 DISALLOW_COPY_AND_ASSIGN(BlimpClientContext);
51 };
52
53 } // namespace client
54 } // namespace blimp
55
56 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698