| 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 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 explicit PermissionPromptAndroid(content::WebContents* web_contents); | 22 explicit PermissionPromptAndroid(content::WebContents* web_contents); |
| 23 ~PermissionPromptAndroid() override; | 23 ~PermissionPromptAndroid() override; |
| 24 | 24 |
| 25 // PermissionPrompt: | 25 // PermissionPrompt: |
| 26 void SetDelegate(Delegate* delegate) override; | 26 void SetDelegate(Delegate* delegate) override; |
| 27 void Show(const std::vector<PermissionRequest*>& requests, | 27 void Show(const std::vector<PermissionRequest*>& requests, |
| 28 const std::vector<bool>& accept_state) override; | 28 const std::vector<bool>& accept_state) override; |
| 29 bool CanAcceptRequestUpdate() override; | 29 bool CanAcceptRequestUpdate() override; |
| 30 bool HidesAutomatically() override; | 30 bool HidesAutomatically() override; |
| 31 void Hide() override; | 31 void Hide() override; |
| 32 bool IsVisible() override; | |
| 33 void UpdateAnchorPosition() override; | 32 void UpdateAnchorPosition() override; |
| 34 gfx::NativeWindow GetNativeWindow() override; | 33 gfx::NativeWindow GetNativeWindow() override; |
| 35 | 34 |
| 36 void Closing(); | 35 void Closing(); |
| 37 void ToggleAccept(int index, bool value); | 36 void ToggleAccept(int index, bool value); |
| 38 void Accept(); | 37 void Accept(); |
| 39 void Deny(); | 38 void Deny(); |
| 40 | 39 |
| 41 size_t permission_count() const { return requests_.size(); } | 40 size_t permission_count() const { return requests_.size(); } |
| 42 ContentSettingsType GetContentSettingType(size_t position) const; | 41 ContentSettingsType GetContentSettingType(size_t position) const; |
| 43 int GetIconIdForPermission(size_t position) const; | 42 int GetIconIdForPermission(size_t position) const; |
| 44 base::string16 GetMessageTextFragment(size_t position) const; | 43 base::string16 GetMessageTextFragment(size_t position) const; |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 // PermissionPromptAndroid is owned by PermissionRequestManager, so it should | 46 // PermissionPromptAndroid is owned by PermissionRequestManager, so it should |
| 48 // be safe to hold a raw WebContents pointer here because this class is | 47 // be safe to hold a raw WebContents pointer here because this class is |
| 49 // destroyed before the WebContents. | 48 // destroyed before the WebContents. |
| 50 content::WebContents* web_contents_; | 49 content::WebContents* web_contents_; |
| 51 // |delegate_| is the PermissionRequestManager, which owns this object. | 50 // |delegate_| is the PermissionRequestManager, which owns this object. |
| 52 Delegate* delegate_; | 51 Delegate* delegate_; |
| 53 // The current request being displayed (if any). | 52 // The current request being displayed (if any). |
| 54 std::vector<PermissionRequest*> requests_; | 53 std::vector<PermissionRequest*> requests_; |
| 55 | 54 |
| 56 DISALLOW_COPY_AND_ASSIGN(PermissionPromptAndroid); | 55 DISALLOW_COPY_AND_ASSIGN(PermissionPromptAndroid); |
| 57 }; | 56 }; |
| 58 | 57 |
| 59 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_ | 58 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_PROMPT_ANDROID_H_ |
| OLD | NEW |