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_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 virtual size_t NumOptions() const = 0; | 78 virtual size_t NumOptions() const = 0; |
79 | 79 |
80 // The signal strength level (0-4 inclusive) of the device at |index|, which | 80 // The signal strength level (0-4 inclusive) of the device at |index|, which |
81 // is used to retrieve the corresponding icon to be displayed before the | 81 // is used to retrieve the corresponding icon to be displayed before the |
82 // text. Returns -1 if no icon should be shown. | 82 // text. Returns -1 if no icon should be shown. |
83 virtual int GetSignalStrengthLevel(size_t index) const; | 83 virtual int GetSignalStrengthLevel(size_t index) const; |
84 | 84 |
85 // The |index|th option string which is listed in the chooser. | 85 // The |index|th option string which is listed in the chooser. |
86 virtual base::string16 GetOption(size_t index) const = 0; | 86 virtual base::string16 GetOption(size_t index) const = 0; |
87 | 87 |
| 88 // Returns if the |index|th option is connected. |
| 89 // This function returns false by default. |
| 90 virtual bool IsConnected(size_t index) const; |
| 91 |
| 92 // Returns if the |index|th option is paired. |
| 93 // This function returns false by default. |
| 94 virtual bool IsPaired(size_t index) const; |
| 95 |
88 // Refresh the list of options. | 96 // Refresh the list of options. |
89 virtual void RefreshOptions() = 0; | 97 virtual void RefreshOptions() = 0; |
90 | 98 |
91 // Returns the status text to be shown in the chooser. | 99 // Returns the status text to be shown in the chooser. |
92 virtual base::string16 GetStatus() const = 0; | 100 virtual base::string16 GetStatus() const = 0; |
93 | 101 |
94 // These three functions are called just before this object is destroyed: | 102 // These three functions are called just before this object is destroyed: |
95 | 103 |
96 // Called when the user selects the |index|th element from the dialog. | 104 // Called when the user selects the |index|th element from the dialog. |
97 virtual void Select(size_t index) = 0; | 105 virtual void Select(size_t index) = 0; |
(...skipping 15 matching lines...) Expand all Loading... |
113 private: | 121 private: |
114 content::RenderFrameHost* const owning_frame_; | 122 content::RenderFrameHost* const owning_frame_; |
115 const int title_string_id_origin_; | 123 const int title_string_id_origin_; |
116 const int title_string_id_extension_; | 124 const int title_string_id_extension_; |
117 View* view_ = nullptr; | 125 View* view_ = nullptr; |
118 | 126 |
119 DISALLOW_COPY_AND_ASSIGN(ChooserController); | 127 DISALLOW_COPY_AND_ASSIGN(ChooserController); |
120 }; | 128 }; |
121 | 129 |
122 #endif // CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ | 130 #endif // CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ |
OLD | NEW |