| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_prompt_android.h" | 5 #include "chrome/browser/permissions/permission_prompt_android.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/infobars/infobar_service.h" | 8 #include "chrome/browser/infobars/infobar_service.h" |
| 9 #include "chrome/browser/permissions/grouped_permission_infobar_delegate_android
.h" | 9 #include "chrome/browser/permissions/grouped_permission_infobar_delegate_android
.h" |
| 10 #include "chrome/browser/permissions/permission_dialog_delegate.h" | 10 #include "chrome/browser/permissions/permission_dialog_delegate.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void PermissionPromptAndroid::Closing() { | 69 void PermissionPromptAndroid::Closing() { |
| 70 if (delegate_) | 70 if (delegate_) |
| 71 delegate_->Closing(); | 71 delegate_->Closing(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void PermissionPromptAndroid::TogglePersist(bool value) { | 74 void PermissionPromptAndroid::TogglePersist(bool value) { |
| 75 if (delegate_) | 75 if (delegate_) |
| 76 delegate_->TogglePersist(value); | 76 delegate_->TogglePersist(value); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void PermissionPromptAndroid::ToggleAccept(int index, bool value) { | |
| 80 if (delegate_) | |
| 81 delegate_->ToggleAccept(index, value); | |
| 82 } | |
| 83 | |
| 84 void PermissionPromptAndroid::Accept() { | 79 void PermissionPromptAndroid::Accept() { |
| 85 if (delegate_) | 80 if (delegate_) |
| 86 delegate_->Accept(); | 81 delegate_->Accept(); |
| 87 } | 82 } |
| 88 | 83 |
| 89 void PermissionPromptAndroid::Deny() { | 84 void PermissionPromptAndroid::Deny() { |
| 90 if (delegate_) | 85 if (delegate_) |
| 91 delegate_->Deny(); | 86 delegate_->Deny(); |
| 92 } | 87 } |
| 93 | 88 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 const std::vector<PermissionRequest*>& requests = delegate_->Requests(); | 122 const std::vector<PermissionRequest*>& requests = delegate_->Requests(); |
| 128 DCHECK_LT(position, requests.size()); | 123 DCHECK_LT(position, requests.size()); |
| 129 return requests[position]->GetMessageTextFragment(); | 124 return requests[position]->GetMessageTextFragment(); |
| 130 } | 125 } |
| 131 | 126 |
| 132 // static | 127 // static |
| 133 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( | 128 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( |
| 134 content::WebContents* web_contents) { | 129 content::WebContents* web_contents) { |
| 135 return base::MakeUnique<PermissionPromptAndroid>(web_contents); | 130 return base::MakeUnique<PermissionPromptAndroid>(web_contents); |
| 136 } | 131 } |
| OLD | NEW |