Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CHOOSER_BUBBLE_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 // Called when GetOption(index) is no longer present, and all later | 45 // Called when GetOption(index) is no longer present, and all later |
| 46 // options have been moved earlier by 1 slot. Calling GetOption(index) | 46 // options have been moved earlier by 1 slot. Calling GetOption(index) |
| 47 // from inside a call to OnOptionRemoved will NOT see the removed string | 47 // from inside a call to OnOptionRemoved will NOT see the removed string |
| 48 // since the options have already been updated. | 48 // since the options have already been updated. |
| 49 virtual void OnOptionRemoved(size_t index) = 0; | 49 virtual void OnOptionRemoved(size_t index) = 0; |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 virtual ~Observer() {} | 52 virtual ~Observer() {} |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // Open help center URL. | |
| 56 void OpenHelpCenterUrl() const; | |
| 57 | |
| 55 // BubbleDelegate: | 58 // BubbleDelegate: |
| 56 std::string GetName() const override; | 59 std::string GetName() const override; |
| 57 scoped_ptr<BubbleUi> BuildBubbleUi() override; | 60 scoped_ptr<BubbleUi> BuildBubbleUi() override; |
| 58 const content::RenderFrameHost* OwningFrame() const override; | 61 const content::RenderFrameHost* OwningFrame() const override; |
| 59 | 62 |
| 60 // The number of options users can pick from. For example, it can be | 63 // The number of options users can pick from. For example, it can be |
| 61 // the number of USB/Bluetooth device names which are listed in the | 64 // the number of USB/Bluetooth device names which are listed in the |
| 62 // chooser bubble so that users can grant permission. | 65 // chooser bubble so that users can grant permission. |
| 63 virtual size_t NumOptions() const = 0; | 66 virtual size_t NumOptions() const = 0; |
| 64 | 67 |
| 65 // The |index|th option string which is listed in the chooser bubble. | 68 // The |index|th option string which is listed in the chooser bubble. |
| 66 virtual const base::string16& GetOption(size_t index) const = 0; | 69 virtual const base::string16& GetOption(size_t index) const = 0; |
| 67 | 70 |
| 68 // These three functions are called just before this object is destroyed: | 71 // These three functions are called just before this object is destroyed: |
| 69 | 72 |
| 70 // Called when the user selects the |index|th element from the dialog. | 73 // Called when the user selects the |index|th element from the dialog. |
| 71 virtual void Select(size_t index) = 0; | 74 virtual void Select(size_t index) = 0; |
| 72 | 75 |
| 73 // Called when the user presses the 'Cancel' button in the dialog. | 76 // Called when the user presses the 'Cancel' button in the dialog. |
| 74 virtual void Cancel() = 0; | 77 virtual void Cancel() = 0; |
| 75 | 78 |
| 76 // Called when the user clicks outside the dialog or the dialog otherwise | 79 // Called when the user clicks outside the dialog or the dialog otherwise |
| 77 // closes without the user taking an explicit action. | 80 // closes without the user taking an explicit action. |
| 78 virtual void Close() = 0; | 81 virtual void Close() = 0; |
| 79 | 82 |
| 83 // Get help center URL. | |
| 84 virtual base::string16 GetHelpCenterUrl() const = 0; | |
|
msw
2016/02/22 20:13:11
Why doesn't this return a GURL?
juncai
2016/02/22 22:06:37
There is a follow-up patch for Mac:
https://codere
Evan Stade
2016/02/22 23:15:16
That is a platform-specific implementation detail.
juncai
2016/02/23 01:34:21
Done.
| |
| 85 | |
| 80 // Only one observer may be registered at a time. | 86 // Only one observer may be registered at a time. |
| 81 void set_observer(Observer* observer) { observer_ = observer; } | 87 void set_observer(Observer* observer) { observer_ = observer; } |
| 82 Observer* observer() const { return observer_; } | 88 Observer* observer() const { return observer_; } |
| 83 | 89 |
| 84 private: | 90 private: |
| 85 Browser* browser_; | 91 Browser* browser_; |
| 86 const content::RenderFrameHost* const owning_frame_; | 92 const content::RenderFrameHost* const owning_frame_; |
| 87 Observer* observer_ = nullptr; | 93 Observer* observer_ = nullptr; |
| 88 | 94 |
| 89 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleDelegate); | 95 DISALLOW_COPY_AND_ASSIGN(ChooserBubbleDelegate); |
| 90 }; | 96 }; |
| 91 | 97 |
| 92 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_ | 98 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_ |
| OLD | NEW |