Chromium Code Reviews| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 void PermissionPromptAndroid::UpdateAnchorPosition() { | 63 void PermissionPromptAndroid::UpdateAnchorPosition() { |
| 64 NOTREACHED() << "UpdateAnchorPosition is not implemented"; | 64 NOTREACHED() << "UpdateAnchorPosition is not implemented"; |
| 65 } | 65 } |
| 66 | 66 |
| 67 gfx::NativeWindow PermissionPromptAndroid::GetNativeWindow() { | 67 gfx::NativeWindow PermissionPromptAndroid::GetNativeWindow() { |
| 68 NOTREACHED() << "GetNativeWindow is not implemented"; | 68 NOTREACHED() << "GetNativeWindow is not implemented"; |
| 69 return nullptr; | 69 return nullptr; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void PermissionPromptAndroid::Closing() { | 72 void PermissionPromptAndroid::Closing() { |
| 73 infobar_ = nullptr; | |
|
raymes
2016/11/30 02:21:48
Hmm, how come this was removed?
lshang
2016/11/30 04:59:00
So the infobar_ should only be set to null after i
raymes
2016/11/30 05:07:12
Ah that makes sense, thanks for explaining!
| |
| 74 if (delegate_) | 73 if (delegate_) |
| 75 delegate_->Closing(); | 74 delegate_->Closing(); |
| 76 } | 75 } |
| 77 | 76 |
| 78 void PermissionPromptAndroid::ToggleAccept(int index, bool value) { | 77 void PermissionPromptAndroid::ToggleAccept(int index, bool value) { |
| 79 if (delegate_) | 78 if (delegate_) |
| 80 delegate_->ToggleAccept(index, value); | 79 delegate_->ToggleAccept(index, value); |
| 81 } | 80 } |
| 82 | 81 |
| 83 void PermissionPromptAndroid::Accept() { | 82 void PermissionPromptAndroid::Accept() { |
| 84 if (delegate_) | 83 if (delegate_) |
| 85 delegate_->Accept(); | 84 delegate_->Accept(); |
| 86 } | 85 } |
| 87 | 86 |
| 88 void PermissionPromptAndroid::Deny() { | 87 void PermissionPromptAndroid::Deny() { |
| 89 if (delegate_) | 88 if (delegate_) |
| 90 delegate_->Deny(); | 89 delegate_->Deny(); |
| 91 } | 90 } |
| 92 | 91 |
| 93 // static | 92 // static |
| 94 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( | 93 std::unique_ptr<PermissionPrompt> PermissionPrompt::Create( |
| 95 content::WebContents* web_contents) { | 94 content::WebContents* web_contents) { |
| 96 return base::MakeUnique<PermissionPromptAndroid>(web_contents); | 95 return base::MakeUnique<PermissionPromptAndroid>(web_contents); |
| 97 } | 96 } |
| OLD | NEW |