| 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 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_PROMPT_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_PROMPT_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_PROMPT_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_PROMPT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // to the manager for the visible tab. | 21 // to the manager for the visible tab. |
| 22 class PermissionPrompt { | 22 class PermissionPrompt { |
| 23 public: | 23 public: |
| 24 // The delegate will receive events caused by user action which need to | 24 // The delegate will receive events caused by user action which need to |
| 25 // be persisted in the per-tab UI state. | 25 // be persisted in the per-tab UI state. |
| 26 class Delegate { | 26 class Delegate { |
| 27 public: | 27 public: |
| 28 virtual ~Delegate() {} | 28 virtual ~Delegate() {} |
| 29 | 29 |
| 30 virtual void ToggleAccept(int index, bool new_value) = 0; | 30 virtual void ToggleAccept(int index, bool new_value) = 0; |
| 31 virtual void TogglePersist(bool new_value) = 0; |
| 31 virtual void Accept() = 0; | 32 virtual void Accept() = 0; |
| 32 virtual void Deny() = 0; | 33 virtual void Deny() = 0; |
| 33 virtual void Closing() = 0; | 34 virtual void Closing() = 0; |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 typedef base::Callback<std::unique_ptr<PermissionPrompt>(Browser*)> Factory; | 37 typedef base::Callback<std::unique_ptr<PermissionPrompt>(Browser*)> Factory; |
| 37 | 38 |
| 38 // Create a platform specific instance. | 39 // Create a platform specific instance. |
| 39 static std::unique_ptr<PermissionPrompt> Create(Browser* browser); | 40 static std::unique_ptr<PermissionPrompt> Create(Browser* browser); |
| 40 virtual ~PermissionPrompt() {} | 41 virtual ~PermissionPrompt() {} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 64 | 65 |
| 65 // Updates where the prompt should be anchored. ex: fullscreen toggle. | 66 // Updates where the prompt should be anchored. ex: fullscreen toggle. |
| 66 virtual void UpdateAnchorPosition() = 0; | 67 virtual void UpdateAnchorPosition() = 0; |
| 67 | 68 |
| 68 // Returns a reference to this prompt's native window. | 69 // Returns a reference to this prompt's native window. |
| 69 // TODO(hcarmona): Remove this as part of the bubble API work. | 70 // TODO(hcarmona): Remove this as part of the bubble API work. |
| 70 virtual gfx::NativeWindow GetNativeWindow() = 0; | 71 virtual gfx::NativeWindow GetNativeWindow() = 0; |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_PROMPT_H_ | 74 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_PROMPT_H_ |
| OLD | NEW |