| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/permissions/permission_request_manager.h" | 5 #include "chrome/browser/permissions/permission_request_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // or use us otherwise during the destruction. | 327 // or use us otherwise during the destruction. |
| 328 web_contents()->RemoveUserData(UserDataKey()); | 328 web_contents()->RemoveUserData(UserDataKey()); |
| 329 // That was the equivalent of "delete this". This object is now destroyed; | 329 // That was the equivalent of "delete this". This object is now destroyed; |
| 330 // returning from this function is the only safe thing to do. | 330 // returning from this function is the only safe thing to do. |
| 331 } | 331 } |
| 332 | 332 |
| 333 const std::vector<PermissionRequest*>& PermissionRequestManager::Requests() { | 333 const std::vector<PermissionRequest*>& PermissionRequestManager::Requests() { |
| 334 return requests_; | 334 return requests_; |
| 335 } | 335 } |
| 336 | 336 |
| 337 const std::vector<bool>& PermissionRequestManager::AcceptStates() { | |
| 338 // TODO(crbug.com/728483): Remove this function. | |
| 339 CR_DEFINE_STATIC_LOCAL(std::vector<bool>, accept_states, ()); | |
| 340 return accept_states; | |
| 341 } | |
| 342 | |
| 343 void PermissionRequestManager::ToggleAccept(int request_index, bool new_value) { | |
| 344 // TODO(crbug.com/728483): Remove this function. | |
| 345 } | |
| 346 | |
| 347 void PermissionRequestManager::TogglePersist(bool new_value) { | 337 void PermissionRequestManager::TogglePersist(bool new_value) { |
| 348 persist_ = new_value; | 338 persist_ = new_value; |
| 349 } | 339 } |
| 350 | 340 |
| 351 void PermissionRequestManager::Accept() { | 341 void PermissionRequestManager::Accept() { |
| 352 PermissionUmaUtil::PermissionPromptAccepted(requests_); | 342 PermissionUmaUtil::PermissionPromptAccepted(requests_); |
| 353 | 343 |
| 354 std::vector<PermissionRequest*>::iterator requests_iter; | 344 std::vector<PermissionRequest*>::iterator requests_iter; |
| 355 for (requests_iter = requests_.begin(); requests_iter != requests_.end(); | 345 for (requests_iter = requests_.begin(); requests_iter != requests_.end(); |
| 356 requests_iter++) { | 346 requests_iter++) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 case DENY_ALL: | 526 case DENY_ALL: |
| 537 Deny(); | 527 Deny(); |
| 538 break; | 528 break; |
| 539 case DISMISS: | 529 case DISMISS: |
| 540 Closing(); | 530 Closing(); |
| 541 break; | 531 break; |
| 542 case NONE: | 532 case NONE: |
| 543 NOTREACHED(); | 533 NOTREACHED(); |
| 544 } | 534 } |
| 545 } | 535 } |
| OLD | NEW |