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

Side by Side Diff: chrome/browser/extensions/app_notify_channel_setup.h

Issue 10386063: Move URLFetcherDelegate to net/ and split URLFetcher between net/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to head, fix win component build Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_
6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_ 6 #define CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 92
93 // Getters for various members. 93 // Getters for various members.
94 const std::string& extension_id() const { return extension_id_; } 94 const std::string& extension_id() const { return extension_id_; }
95 const std::string& client_id() const { return client_id_; } 95 const std::string& client_id() const { return client_id_; }
96 int return_route_id() const { return return_route_id_; } 96 int return_route_id() const { return return_route_id_; }
97 int callback_id() const { return callback_id_; } 97 int callback_id() const { return callback_id_; }
98 98
99 protected: 99 protected:
100 // content::URLFetcherDelegate. 100 // content::URLFetcherDelegate.
101 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; 101 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
102 102
103 // AppNotifyChannelUI::Delegate. 103 // AppNotifyChannelUI::Delegate.
104 virtual void OnSyncSetupResult(bool enabled) OVERRIDE; 104 virtual void OnSyncSetupResult(bool enabled) OVERRIDE;
105 105
106 private: 106 private:
107 enum State { 107 enum State {
108 INITIAL, 108 INITIAL,
109 LOGIN_STARTED, 109 LOGIN_STARTED,
110 LOGIN_DONE, 110 LOGIN_DONE,
111 FETCH_ACCESS_TOKEN_STARTED, 111 FETCH_ACCESS_TOKEN_STARTED,
(...skipping 13 matching lines...) Expand all
125 // Creates an instance of URLFetcher that does not send or save cookies. 125 // Creates an instance of URLFetcher that does not send or save cookies.
126 // The URLFether's method will be GET if body is empty, POST otherwise. 126 // The URLFether's method will be GET if body is empty, POST otherwise.
127 // Caller owns the returned instance. 127 // Caller owns the returned instance.
128 content::URLFetcher* CreateURLFetcher( 128 content::URLFetcher* CreateURLFetcher(
129 const GURL& url, const std::string& body, const std::string& auth_token); 129 const GURL& url, const std::string& body, const std::string& auth_token);
130 void BeginLogin(); 130 void BeginLogin();
131 void EndLogin(bool success); 131 void EndLogin(bool success);
132 void BeginGetAccessToken(); 132 void BeginGetAccessToken();
133 void EndGetAccessToken(bool success); 133 void EndGetAccessToken(bool success);
134 void BeginRecordGrant(); 134 void BeginRecordGrant();
135 void EndRecordGrant(const content::URLFetcher* source); 135 void EndRecordGrant(const net::URLFetcher* source);
136 void BeginGetChannelId(); 136 void BeginGetChannelId();
137 void EndGetChannelId(const content::URLFetcher* source); 137 void EndGetChannelId(const net::URLFetcher* source);
138 138
139 void ReportResult(const std::string& channel_id, SetupError error); 139 void ReportResult(const std::string& channel_id, SetupError error);
140 140
141 static std::string GetErrorString(SetupError error); 141 static std::string GetErrorString(SetupError error);
142 static GURL GetCWSChannelServiceURL(); 142 static GURL GetCWSChannelServiceURL();
143 static GURL GetOAuth2IssueTokenURL(); 143 static GURL GetOAuth2IssueTokenURL();
144 static std::string MakeOAuth2IssueTokenBody( 144 static std::string MakeOAuth2IssueTokenBody(
145 const std::string& oauth_client_id, const std::string& extension_id); 145 const std::string& oauth_client_id, const std::string& extension_id);
146 static std::string MakeAuthorizationHeader(const std::string& auth_token); 146 static std::string MakeAuthorizationHeader(const std::string& auth_token);
147 static bool ParseCWSChannelServiceResponse( 147 static bool ParseCWSChannelServiceResponse(
(...skipping 18 matching lines...) Expand all
166 // Keeps track of whether we have encountered failure in OAuth2 access 166 // Keeps track of whether we have encountered failure in OAuth2 access
167 // token generation already. We use this to prevent us from doing an 167 // token generation already. We use this to prevent us from doing an
168 // infinite loop of trying to generate access token, if that fails, try 168 // infinite loop of trying to generate access token, if that fails, try
169 // to login the user and generate access token, etc. 169 // to login the user and generate access token, etc.
170 bool oauth2_access_token_failure_; 170 bool oauth2_access_token_failure_;
171 171
172 DISALLOW_COPY_AND_ASSIGN(AppNotifyChannelSetup); 172 DISALLOW_COPY_AND_ASSIGN(AppNotifyChannelSetup);
173 }; 173 };
174 174
175 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_ 175 #endif // CHROME_BROWSER_EXTENSIONS_APP_NOTIFY_CHANNEL_SETUP_H_
OLDNEW
« no previous file with comments | « chrome/browser/component_updater/component_updater_service.cc ('k') | chrome/browser/extensions/app_notify_channel_setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698