| 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 "content/ppapi_plugin/broker_process_dispatcher.h" | 5 #include "content/ppapi_plugin/broker_process_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 void GetPermissionSettingsCallback( | 43 void GetPermissionSettingsCallback( |
| 44 void* user_data, | 44 void* user_data, |
| 45 PP_Bool success, | 45 PP_Bool success, |
| 46 PP_Flash_BrowserOperations_Permission default_permission, | 46 PP_Flash_BrowserOperations_Permission default_permission, |
| 47 uint32_t site_count, | 47 uint32_t site_count, |
| 48 const PP_Flash_BrowserOperations_SiteSetting sites[]) { | 48 const PP_Flash_BrowserOperations_SiteSetting sites[]) { |
| 49 scoped_ptr<GetPermissionSettingsContext> context( | 49 scoped_ptr<GetPermissionSettingsContext> context( |
| 50 reinterpret_cast<GetPermissionSettingsContext*>(user_data)); | 50 reinterpret_cast<GetPermissionSettingsContext*>(user_data)); |
| 51 | 51 |
| 52 if (!context->dispatcher) | 52 if (!context->dispatcher.get()) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 ppapi::FlashSiteSettings site_vector; | 55 ppapi::FlashSiteSettings site_vector; |
| 56 if (success) { | 56 if (success) { |
| 57 site_vector.reserve(site_count); | 57 site_vector.reserve(site_count); |
| 58 for (uint32_t i = 0; i < site_count; ++i) { | 58 for (uint32_t i = 0; i < site_count; ++i) { |
| 59 if (!sites[i].site) { | 59 if (!sites[i].site) { |
| 60 success = PP_FALSE; | 60 success = PP_FALSE; |
| 61 break; | 61 break; |
| 62 } | 62 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 PP_Bool result = flash_browser_operations_1_2_->SetSitePermission( | 323 PP_Bool result = flash_browser_operations_1_2_->SetSitePermission( |
| 324 data_str.c_str(), setting_type, sites.size(), site_array.get()); | 324 data_str.c_str(), setting_type, sites.size(), site_array.get()); |
| 325 | 325 |
| 326 return PP_ToBool(result); | 326 return PP_ToBool(result); |
| 327 } | 327 } |
| 328 | 328 |
| 329 return false; | 329 return false; |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace content | 332 } // namespace content |
| OLD | NEW |