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

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

Issue 2204223005: Blimp OAuth2 token retreival on application start up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add some deps only for gn deps check script. 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_PUBLIC_BLIMP_CLIENT_CONTEXT_DELEGATE_H_ 5 #ifndef BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_DELEGATE_H_
6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_DELEGATE_H_ 6 #define BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_DELEGATE_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "blimp/client/public/session/assignment.h" 9 #include "blimp/client/public/session/assignment.h"
10 10
11 class IdentityProvider;
12
11 namespace blimp { 13 namespace blimp {
12 namespace client { 14 namespace client {
13 class BlimpContents; 15 class BlimpContents;
14 16
15 // BlimpClientContextDelegate is how the BlimpClientContext gets the 17 // BlimpClientContextDelegate is how the BlimpClientContext gets the
16 // functionality it needs from its embedder. 18 // functionality it needs from its embedder.
17 class BlimpClientContextDelegate { 19 class BlimpClientContextDelegate {
18 public: 20 public:
21 // Error propagated to the embedder.
22 enum BlimpError {
nyquist 2016/08/12 05:47:05 Do we want to specify that this is Identity-relate
xingliu 2016/08/12 21:11:18 Not sure, I guess this is errors to the embedder.
23 NOT_SIGNED_IN = 0,
24 OAUTH_TOKEN_FAIL,
25 };
26
19 virtual ~BlimpClientContextDelegate() = default; 27 virtual ~BlimpClientContextDelegate() = default;
20 28
21 // Attaches any required base::SupportsUserData::Data to the BlimpContents. 29 // Attaches any required base::SupportsUserData::Data to the BlimpContents.
22 virtual void AttachBlimpContentsHelpers(BlimpContents* blimp_contents) = 0; 30 virtual void AttachBlimpContentsHelpers(BlimpContents* blimp_contents) = 0;
23 31
24 // Called whenever an assignment request has finished and the resulting 32 // Called whenever an assignment request has finished and the resulting
25 // Assignment is ready to be used in an attempt to connect to the engine. The 33 // Assignment is ready to be used in an attempt to connect to the engine. The
26 // |result| is the result for the assignment request itself, not for the 34 // |result| is the result for the assignment request itself, not for the
27 // connection attempt. Only when |result| is ASSIGNMENT_REQUEST_RESULT_OK 35 // connection attempt. Only when |result| is ASSIGNMENT_REQUEST_RESULT_OK
28 // will an attempt actually be made to connect to the engine using the 36 // will an attempt actually be made to connect to the engine using the
29 // Assignment. 37 // Assignment.
30 virtual void OnAssignmentConnectionAttempted( 38 virtual void OnAssignmentConnectionAttempted(
31 AssignmentRequestResult result, 39 AssignmentRequestResult result,
32 const Assignment& assignment) = 0; 40 const Assignment& assignment) = 0;
33 41
42 // Create IdentityProvider for OAuth2 token retrieval, used in Authenticator.
43 virtual std::unique_ptr<IdentityProvider> CreateIdentityProvider() = 0;
44
45 // Propagate error to the embedder.
46 virtual void OnError(BlimpClientContextDelegate::BlimpError error) = 0;
nyquist 2016/08/12 05:47:05 Similarly to the BlimpError enum, do we want to ha
xingliu 2016/08/12 21:11:18 Can I put the errors in public? So the delegate an
47
34 protected: 48 protected:
35 BlimpClientContextDelegate() = default; 49 BlimpClientContextDelegate() = default;
36 50
37 private: 51 private:
38 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextDelegate); 52 DISALLOW_COPY_AND_ASSIGN(BlimpClientContextDelegate);
39 }; 53 };
40 54
41 } // namespace client 55 } // namespace client
42 } // namespace blimp 56 } // namespace blimp
43 57
44 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_DELEGATE_H_ 58 #endif // BLIMP_CLIENT_PUBLIC_BLIMP_CLIENT_CONTEXT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698