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