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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 // Called when refreshing options is in progress or complete. | 55 // Called when refreshing options is in progress or complete. |
56 virtual void OnRefreshStateChanged(bool refreshing) = 0; | 56 virtual void OnRefreshStateChanged(bool refreshing) = 0; |
57 | 57 |
58 protected: | 58 protected: |
59 virtual ~View() {} | 59 virtual ~View() {} |
60 }; | 60 }; |
61 | 61 |
62 // Returns the text to be displayed in the chooser title. | 62 // Returns the text to be displayed in the chooser title. |
63 base::string16 GetTitle() const; | 63 base::string16 GetTitle() const; |
64 | 64 |
65 // Returns if the chooser needs to show an icon before the text. | |
66 virtual bool ShouldShowIconBeforeText() const; | |
Jeffrey Yasskin
2016/08/19 17:46:54
This should say that it's a signal strength icon.
juncai
2016/08/19 22:59:16
Done.
| |
67 | |
65 // Returns the text to be displayed in the chooser when there are no options. | 68 // Returns the text to be displayed in the chooser when there are no options. |
66 virtual base::string16 GetNoOptionsText() const = 0; | 69 virtual base::string16 GetNoOptionsText() const = 0; |
67 | 70 |
68 // Returns the label for OK button. | 71 // Returns the label for OK button. |
69 virtual base::string16 GetOkButtonLabel() const = 0; | 72 virtual base::string16 GetOkButtonLabel() const = 0; |
70 | 73 |
71 // The number of options users can pick from. For example, it can be | 74 // The number of options users can pick from. For example, it can be |
72 // the number of USB/Bluetooth device names which are listed in the | 75 // the number of USB/Bluetooth device names which are listed in the |
73 // chooser so that users can grant permission. | 76 // chooser so that users can grant permission. |
74 virtual size_t NumOptions() const = 0; | 77 virtual size_t NumOptions() const = 0; |
75 | 78 |
79 // The signal strength level (non-negative) of the device at |index|, which | |
Jeffrey Yasskin
2016/08/19 17:46:54
Can you say what the valid levels are? This is 0-4
juncai
2016/08/19 22:59:16
Done.
| |
80 // is used to retrieve the corresponding icon to be displayed before the | |
81 // text. Returns -1 if no icon should be shown. | |
82 virtual int GetSignalStrengthLevel(size_t index) const; | |
83 | |
76 // The |index|th option string which is listed in the chooser. | 84 // The |index|th option string which is listed in the chooser. |
77 virtual base::string16 GetOption(size_t index) const = 0; | 85 virtual base::string16 GetOption(size_t index) const = 0; |
78 | 86 |
79 // Refresh the list of options. | 87 // Refresh the list of options. |
80 virtual void RefreshOptions() = 0; | 88 virtual void RefreshOptions() = 0; |
81 | 89 |
82 // Returns the status text to be shown in the chooser. | 90 // Returns the status text to be shown in the chooser. |
83 virtual base::string16 GetStatus() const = 0; | 91 virtual base::string16 GetStatus() const = 0; |
84 | 92 |
85 // These three functions are called just before this object is destroyed: | 93 // These three functions are called just before this object is destroyed: |
(...skipping 18 matching lines...) Expand all Loading... | |
104 private: | 112 private: |
105 content::RenderFrameHost* const owning_frame_; | 113 content::RenderFrameHost* const owning_frame_; |
106 const int title_string_id_origin_; | 114 const int title_string_id_origin_; |
107 const int title_string_id_extension_; | 115 const int title_string_id_extension_; |
108 View* view_ = nullptr; | 116 View* view_ = nullptr; |
109 | 117 |
110 DISALLOW_COPY_AND_ASSIGN(ChooserController); | 118 DISALLOW_COPY_AND_ASSIGN(ChooserController); |
111 }; | 119 }; |
112 | 120 |
113 #endif // CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ | 121 #endif // CHROME_BROWSER_CHOOSER_CONTROLLER_CHOOSER_CONTROLLER_H_ |
OLD | NEW |