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 // Implements the Chrome Extensions Cookies API. | 5 // Implements the Chrome Extensions Cookies API. |
6 | 6 |
7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" | 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 BrowserThread::UI, FROM_HERE, | 316 BrowserThread::UI, FROM_HERE, |
317 base::Bind(&GetAllCookiesFunction::RespondOnUIThread, this)); | 317 base::Bind(&GetAllCookiesFunction::RespondOnUIThread, this)); |
318 DCHECK(rv); | 318 DCHECK(rv); |
319 } | 319 } |
320 | 320 |
321 void GetAllCookiesFunction::RespondOnUIThread() { | 321 void GetAllCookiesFunction::RespondOnUIThread() { |
322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
323 SendResponse(true); | 323 SendResponse(true); |
324 } | 324 } |
325 | 325 |
326 SetCookieFunction::SetCookieFunction() { | 326 SetCookieFunction::SetCookieFunction() : success_(false) { |
327 } | 327 } |
328 | 328 |
329 SetCookieFunction::~SetCookieFunction() { | 329 SetCookieFunction::~SetCookieFunction() { |
330 } | 330 } |
331 | 331 |
332 bool SetCookieFunction::RunImpl() { | 332 bool SetCookieFunction::RunImpl() { |
333 parsed_args_ = Set::Params::Create(*args_); | 333 parsed_args_ = Set::Params::Create(*args_); |
334 EXTENSION_FUNCTION_VALIDATE(parsed_args_.get()); | 334 EXTENSION_FUNCTION_VALIDATE(parsed_args_.get()); |
335 | 335 |
336 // Read/validate input parameters. | 336 // Read/validate input parameters. |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 } | 538 } |
539 results_ = GetAllCookieStores::Results::Create(cookie_stores); | 539 results_ = GetAllCookieStores::Results::Create(cookie_stores); |
540 return true; | 540 return true; |
541 } | 541 } |
542 | 542 |
543 void GetAllCookieStoresFunction::Run() { | 543 void GetAllCookieStoresFunction::Run() { |
544 SendResponse(RunImpl()); | 544 SendResponse(RunImpl()); |
545 } | 545 } |
546 | 546 |
547 } // namespace extensions | 547 } // namespace extensions |
OLD | NEW |