| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 if (it->Name() == parsed_args_->details.name) { | 249 if (it->Name() == parsed_args_->details.name) { |
| 250 scoped_ptr<Cookie> cookie( | 250 scoped_ptr<Cookie> cookie( |
| 251 cookies_helpers::CreateCookie(*it, *parsed_args_->details.store_id)); | 251 cookies_helpers::CreateCookie(*it, *parsed_args_->details.store_id)); |
| 252 results_ = Get::Results::Create(*cookie); | 252 results_ = Get::Results::Create(*cookie); |
| 253 break; | 253 break; |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 // The cookie doesn't exist; return null. | 257 // The cookie doesn't exist; return null. |
| 258 if (it == cookie_list.end()) | 258 if (it == cookie_list.end()) |
| 259 SetResult(Value::CreateNullValue()); | 259 SetResult(base::Value::CreateNullValue()); |
| 260 | 260 |
| 261 bool rv = BrowserThread::PostTask( | 261 bool rv = BrowserThread::PostTask( |
| 262 BrowserThread::UI, FROM_HERE, | 262 BrowserThread::UI, FROM_HERE, |
| 263 base::Bind(&CookiesGetFunction::RespondOnUIThread, this)); | 263 base::Bind(&CookiesGetFunction::RespondOnUIThread, this)); |
| 264 DCHECK(rv); | 264 DCHECK(rv); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void CookiesGetFunction::RespondOnUIThread() { | 267 void CookiesGetFunction::RespondOnUIThread() { |
| 268 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 268 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 269 SendResponse(true); | 269 SendResponse(true); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 return &g_factory.Get(); | 579 return &g_factory.Get(); |
| 580 } | 580 } |
| 581 | 581 |
| 582 void CookiesAPI::OnListenerAdded( | 582 void CookiesAPI::OnListenerAdded( |
| 583 const extensions::EventListenerInfo& details) { | 583 const extensions::EventListenerInfo& details) { |
| 584 cookies_event_router_.reset(new CookiesEventRouter(profile_)); | 584 cookies_event_router_.reset(new CookiesEventRouter(profile_)); |
| 585 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); | 585 ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace extensions | 588 } // namespace extensions |
| OLD | NEW |