| 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/media/webrtc/media_stream_devices_controller.h" | 9 #include "chrome/browser/media/webrtc/media_stream_devices_controller.h" |
| 10 #include "chrome/browser/permissions/grouped_permission_infobar_delegate_android
.h" | 10 #include "chrome/browser/permissions/grouped_permission_infobar_delegate_android
.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 void PermissionPromptAndroid::UpdateAnchorPosition() { | 61 void PermissionPromptAndroid::UpdateAnchorPosition() { |
| 62 NOTREACHED() << "UpdateAnchorPosition is not implemented"; | 62 NOTREACHED() << "UpdateAnchorPosition is not implemented"; |
| 63 } | 63 } |
| 64 | 64 |
| 65 gfx::NativeWindow PermissionPromptAndroid::GetNativeWindow() { | 65 gfx::NativeWindow PermissionPromptAndroid::GetNativeWindow() { |
| 66 NOTREACHED() << "GetNativeWindow is not implemented"; | 66 NOTREACHED() << "GetNativeWindow is not implemented"; |
| 67 return nullptr; | 67 return nullptr; |
| 68 } | 68 } |
| 69 | 69 |
| 70 void PermissionPromptAndroid::Closing() { | 70 void PermissionPromptAndroid::Closing() { |
| 71 infobar_ = nullptr; | |
| 72 if (delegate_) | 71 if (delegate_) |
| 73 delegate_->Closing(); | 72 delegate_->Closing(); |
| 74 } | 73 } |
| 75 | 74 |
| 76 void PermissionPromptAndroid::ToggleAccept(int index, bool value) { | 75 void PermissionPromptAndroid::ToggleAccept(int index, bool value) { |
| 77 if (delegate_) | 76 if (delegate_) |
| 78 delegate_->ToggleAccept(index, value); | 77 delegate_->ToggleAccept(index, value); |
| 79 } | 78 } |
| 80 | 79 |
| 81 void PermissionPromptAndroid::Accept() { | 80 void PermissionPromptAndroid::Accept() { |
| 82 if (delegate_) | 81 if (delegate_) |
| 83 delegate_->Accept(); | 82 delegate_->Accept(); |
| 84 } | 83 } |
| 85 | 84 |
| 86 void PermissionPromptAndroid::Deny() { | 85 void PermissionPromptAndroid::Deny() { |
| 87 if (delegate_) | 86 if (delegate_) |
| 88 delegate_->Deny(); | 87 delegate_->Deny(); |
| 89 } | 88 } |
| 90 | 89 |
| 91 // static | 90 // static |
| 92 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( | 91 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( |
| 93 content::WebContents* web_contents) { | 92 content::WebContents* web_contents) { |
| 94 return base::MakeUnique<PermissionPromptAndroid>(web_contents); | 93 return base::MakeUnique<PermissionPromptAndroid>(web_contents); |
| 95 } | 94 } |
| OLD | NEW |