| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_cookies_api.h" | 7 #include "chrome/browser/extensions/extension_cookies_api.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 339 } |
| 340 if (details->HasKey(keys::kHttpOnlyKey)) { | 340 if (details->HasKey(keys::kHttpOnlyKey)) { |
| 341 EXTENSION_FUNCTION_VALIDATE( | 341 EXTENSION_FUNCTION_VALIDATE( |
| 342 details->GetBoolean(keys::kHttpOnlyKey, &http_only_)); | 342 details->GetBoolean(keys::kHttpOnlyKey, &http_only_)); |
| 343 } | 343 } |
| 344 if (details->HasKey(keys::kExpirationDateKey)) { | 344 if (details->HasKey(keys::kExpirationDateKey)) { |
| 345 Value* expiration_date_value; | 345 Value* expiration_date_value; |
| 346 EXTENSION_FUNCTION_VALIDATE(details->Get(keys::kExpirationDateKey, | 346 EXTENSION_FUNCTION_VALIDATE(details->Get(keys::kExpirationDateKey, |
| 347 &expiration_date_value)); | 347 &expiration_date_value)); |
| 348 double expiration_date; | 348 double expiration_date; |
| 349 if (expiration_date_value->IsType(Value::TYPE_INTEGER)) { | 349 if (expiration_date_value->IsInteger()) { |
| 350 int expiration_date_int; | 350 int expiration_date_int; |
| 351 EXTENSION_FUNCTION_VALIDATE( | 351 EXTENSION_FUNCTION_VALIDATE( |
| 352 expiration_date_value->GetAsInteger(&expiration_date_int)); | 352 expiration_date_value->GetAsInteger(&expiration_date_int)); |
| 353 expiration_date = static_cast<double>(expiration_date_int); | 353 expiration_date = static_cast<double>(expiration_date_int); |
| 354 } else { | 354 } else { |
| 355 EXTENSION_FUNCTION_VALIDATE( | 355 EXTENSION_FUNCTION_VALIDATE( |
| 356 expiration_date_value->GetAsDouble(&expiration_date)); | 356 expiration_date_value->GetAsDouble(&expiration_date)); |
| 357 } | 357 } |
| 358 // Time::FromDoubleT converts double time 0 to empty Time object. So we need | 358 // Time::FromDoubleT converts double time 0 to empty Time object. So we need |
| 359 // to do special handling here. | 359 // to do special handling here. |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 extension_cookies_helpers::CreateCookieStoreValue( | 532 extension_cookies_helpers::CreateCookieStoreValue( |
| 533 incognito_profile, incognito_tab_ids.release())); | 533 incognito_profile, incognito_tab_ids.release())); |
| 534 } | 534 } |
| 535 result_.reset(cookie_store_list); | 535 result_.reset(cookie_store_list); |
| 536 return true; | 536 return true; |
| 537 } | 537 } |
| 538 | 538 |
| 539 void GetAllCookieStoresFunction::Run() { | 539 void GetAllCookieStoresFunction::Run() { |
| 540 SendResponse(RunImpl()); | 540 SendResponse(RunImpl()); |
| 541 } | 541 } |
| OLD | NEW |