Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_CHROMEOS_GDATA_OPERATIONS_BASE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | |
| 12 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | |
| 11 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" | 13 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" |
| 12 #include "chrome/browser/chromeos/gdata/gdata_params.h" | |
| 13 #include "chrome/common/net/gaia/oauth2_access_token_consumer.h" | 14 #include "chrome/common/net/gaia/oauth2_access_token_consumer.h" |
| 15 #include "googleurl/src/gurl.h" | |
| 14 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
| 15 #include "net/url_request/url_fetcher.h" | 17 #include "net/url_request/url_fetcher.h" |
| 16 #include "net/url_request/url_fetcher_delegate.h" | 18 #include "net/url_request/url_fetcher_delegate.h" |
| 17 | 19 |
| 18 class OAuth2AccessTokenFetcher; | 20 class OAuth2AccessTokenFetcher; |
| 19 | 21 |
| 20 namespace gdata { | 22 namespace gdata { |
| 21 | 23 |
| 24 // Callback type for authentication related DocumentService calls. | |
| 25 typedef base::Callback<void(GDataErrorCode error, | |
| 26 const std::string& token)> AuthStatusCallback; | |
|
satorux1
2012/08/09 20:53:48
move this to where class AuthOperation is defined?
yoshiki
2012/08/09 22:00:46
Done.
| |
| 27 | |
| 28 // Callback type for DocumentServiceInterface::GetDocuments. | |
| 29 // Note: feed_data argument should be passed using base::Passed(&feed_data), not | |
| 30 // feed_data.Pass(). | |
| 31 typedef base::Callback<void(GDataErrorCode error, | |
| 32 scoped_ptr<base::Value> feed_data)> GetDataCallback; | |
|
satorux1
2012/08/09 20:53:48
ditto. move it to GetDataOperation section.
yoshiki
2012/08/09 22:00:46
Done.
| |
| 33 | |
| 34 // Callback type for Delete/Move DocumentServiceInterface calls. | |
| 35 typedef base::Callback<void(GDataErrorCode error, | |
| 36 const GURL& document_url)> EntryActionCallback; | |
| 37 | |
| 22 //================================ AuthOperation =============================== | 38 //================================ AuthOperation =============================== |
| 23 | 39 |
| 24 // OAuth2 authorization token retrieval operation. | 40 // OAuth2 authorization token retrieval operation. |
| 25 class AuthOperation : public GDataOperationRegistry::Operation, | 41 class AuthOperation : public GDataOperationRegistry::Operation, |
| 26 public OAuth2AccessTokenConsumer { | 42 public OAuth2AccessTokenConsumer { |
| 27 public: | 43 public: |
| 28 AuthOperation(GDataOperationRegistry* registry, | 44 AuthOperation(GDataOperationRegistry* registry, |
| 29 const AuthStatusCallback& callback, | 45 const AuthStatusCallback& callback, |
| 30 const std::string& refresh_token); | 46 const std::string& refresh_token); |
| 31 virtual ~AuthOperation(); | 47 virtual ~AuthOperation(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 | 218 |
| 203 // Note: This should remain the last member so it'll be destroyed and | 219 // Note: This should remain the last member so it'll be destroyed and |
| 204 // invalidate its weak pointers before any other members are destroyed. | 220 // invalidate its weak pointers before any other members are destroyed. |
| 205 base::WeakPtrFactory<GetDataOperation> weak_ptr_factory_; | 221 base::WeakPtrFactory<GetDataOperation> weak_ptr_factory_; |
| 206 DISALLOW_COPY_AND_ASSIGN(GetDataOperation); | 222 DISALLOW_COPY_AND_ASSIGN(GetDataOperation); |
| 207 }; | 223 }; |
| 208 | 224 |
| 209 } // namespace gdata | 225 } // namespace gdata |
| 210 | 226 |
| 211 #endif // CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ | 227 #endif // CHROME_BROWSER_CHROMEOS_GDATA_OPERATIONS_BASE_H_ |
| OLD | NEW |