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

Side by Side Diff: blimp/client/core/blimp_client_context_impl.h

Issue 2261273002: Integrate UI with authentication flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Misc fix. Created 4 years, 4 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
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_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ 5 #ifndef BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_
6 #define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ 6 #define BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/threading/thread.h" 14 #include "base/threading/thread.h"
15 #include "blimp/client/core/blimp_client_context_internal.h"
David Trainor- moved to gerrit 2016/08/29 05:12:24 Is this used here?
xingliu 2016/08/30 04:47:42 I first expose the identity source in the base cla
15 #include "blimp/client/core/session/client_network_components.h" 16 #include "blimp/client/core/session/client_network_components.h"
16 #include "blimp/client/core/session/identity_source.h" 17 #include "blimp/client/core/session/identity_source.h"
17 #include "blimp/client/core/session/network_event_observer.h" 18 #include "blimp/client/core/session/network_event_observer.h"
18 #include "blimp/client/public/blimp_client_context.h" 19 #include "blimp/client/public/blimp_client_context.h"
19 #include "blimp/client/public/contents/blimp_contents.h" 20 #include "blimp/client/public/contents/blimp_contents.h"
20 #include "blimp/client/public/session/assignment.h" 21 #include "blimp/client/public/session/assignment.h"
21 #include "blimp/net/thread_pipe_manager.h" 22 #include "blimp/net/thread_pipe_manager.h"
22 #include "url/gurl.h" 23 #include "url/gurl.h"
23 24
24 namespace blimp { 25 namespace blimp {
(...skipping 25 matching lines...) Expand all
50 void OnConnected() override; 51 void OnConnected() override;
51 void OnDisconnected(int result) override; 52 void OnDisconnected(int result) override;
52 53
53 TabControlFeature* GetTabControlFeature() const; 54 TabControlFeature* GetTabControlFeature() const;
54 55
55 protected: 56 protected:
56 // Returns the URL to use for connections to the assigner. Used to construct 57 // Returns the URL to use for connections to the assigner. Used to construct
57 // the AssignmentSource. 58 // the AssignmentSource.
58 virtual GURL GetAssignerURL(); 59 virtual GURL GetAssignerURL();
59 60
61 // Create IdentitySource which provides user sign in states and OAuth2 token
62 // service.
63 void CreateIdentitySource();
64
65 // Provide OAuth2 token and propagate account sign in states change.
66 std::unique_ptr<IdentitySource> identity_source_;
67
60 private: 68 private:
61 // Connect to assignment source with OAuth2 token to get an assignment. 69 // Connect to assignment source with OAuth2 token to get an assignment.
62 virtual void ConnectToAssignmentSource(const std::string& client_auth_token); 70 virtual void ConnectToAssignmentSource(const std::string& client_auth_token);
63 71
64 // The AssignmentCallback for when an assignment is ready. This will trigger 72 // The AssignmentCallback for when an assignment is ready. This will trigger
65 // a connection to the engine. 73 // a connection to the engine.
66 virtual void ConnectWithAssignment(AssignmentRequestResult result, 74 virtual void ConnectWithAssignment(AssignmentRequestResult result,
67 const Assignment& assignment); 75 const Assignment& assignment);
68 76
69 void RegisterFeatures(); 77 void RegisterFeatures();
(...skipping 14 matching lines...) Expand all
84 std::unique_ptr<TabControlFeature> tab_control_feature_; 92 std::unique_ptr<TabControlFeature> tab_control_feature_;
85 93
86 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_; 94 std::unique_ptr<BlimpContentsManager> blimp_contents_manager_;
87 95
88 // Container struct for network components. 96 // Container struct for network components.
89 // Must be deleted on the IO thread. 97 // Must be deleted on the IO thread.
90 std::unique_ptr<ClientNetworkComponents> net_components_; 98 std::unique_ptr<ClientNetworkComponents> net_components_;
91 99
92 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_; 100 std::unique_ptr<ThreadPipeManager> thread_pipe_manager_;
93 101
94 // Provide OAuth2 token and propagate account sign in states change.
95 std::unique_ptr<IdentitySource> identity_source_;
96
97 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_; 102 base::WeakPtrFactory<BlimpClientContextImpl> weak_factory_;
98 103
99 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl); 104 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextImpl);
100 }; 105 };
101 106
102 } // namespace client 107 } // namespace client
103 } // namespace blimp 108 } // namespace blimp
104 109
105 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_ 110 #endif // BLIMP_CLIENT_CORE_BLIMP_CLIENT_CONTEXT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698