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 #include "chrome/browser/google_apis/base_operations.h" | 5 #include "chrome/browser/google_apis/base_operations.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 base::WeakPtr<AuthenticatedOperationInterface> | 316 base::WeakPtr<AuthenticatedOperationInterface> |
317 UrlFetchOperationBase::GetWeakPtr() { | 317 UrlFetchOperationBase::GetWeakPtr() { |
318 return weak_ptr_factory_.GetWeakPtr(); | 318 return weak_ptr_factory_.GetWeakPtr(); |
319 } | 319 } |
320 | 320 |
321 | 321 |
322 //============================ EntryActionOperation ============================ | 322 //============================ EntryActionOperation ============================ |
323 | 323 |
324 EntryActionOperation::EntryActionOperation(OperationRegistry* registry, | 324 EntryActionOperation::EntryActionOperation(OperationRegistry* registry, |
325 const EntryActionCallback& callback, | 325 const EntryActionCallback& callback) |
326 const GURL& document_url) | |
327 : UrlFetchOperationBase(registry), | 326 : UrlFetchOperationBase(registry), |
328 callback_(callback), | 327 callback_(callback) { |
329 document_url_(document_url) { | |
330 } | 328 } |
331 | 329 |
332 EntryActionOperation::~EntryActionOperation() {} | 330 EntryActionOperation::~EntryActionOperation() {} |
333 | 331 |
334 void EntryActionOperation::ProcessURLFetchResults(const URLFetcher* source) { | 332 void EntryActionOperation::ProcessURLFetchResults(const URLFetcher* source) { |
335 if (!callback_.is_null()) { | 333 if (!callback_.is_null()) { |
336 GDataErrorCode code = GetErrorCode(source); | 334 GDataErrorCode code = GetErrorCode(source); |
337 callback_.Run(code); | 335 callback_.Run(code); |
338 } | 336 } |
339 const bool success = true; | 337 const bool success = true; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 413 } |
416 | 414 |
417 void GetDataOperation::RunCallback(GDataErrorCode fetch_error_code, | 415 void GetDataOperation::RunCallback(GDataErrorCode fetch_error_code, |
418 scoped_ptr<base::Value> value) { | 416 scoped_ptr<base::Value> value) { |
419 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 417 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
420 if (!callback_.is_null()) | 418 if (!callback_.is_null()) |
421 callback_.Run(fetch_error_code, value.Pass()); | 419 callback_.Run(fetch_error_code, value.Pass()); |
422 } | 420 } |
423 | 421 |
424 } // namespace google_apis | 422 } // namespace google_apis |
OLD | NEW |