OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_OPTIONS_H_ | |
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_OPTIONS_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/macros.h" | |
12 #include "base/strings/string16.h" | |
13 | |
14 // Stores all the available chooser options, handle options initialization, | |
Jeffrey Yasskin
2015/12/05 01:13:53
What is a "chooser option"?
juncai
2015/12/07 18:28:47
chooser option is the item in the list that the ch
Jeffrey Yasskin
2015/12/07 23:57:54
Include that in the comment, so folks can read the
| |
15 // option added/removed. | |
16 class ChooserOptions { | |
17 public: | |
18 ChooserOptions() {} | |
19 virtual ~ChooserOptions() {} | |
20 | |
21 class Observer { | |
Jeffrey Yasskin
2015/12/05 01:13:53
How are subclasses supposed to use the Observer? B
juncai
2015/12/07 18:28:47
It is the base class of ChooserTableModel:
https:/
Jeffrey Yasskin
2015/12/07 23:57:54
Again, write this sort of thing down in the class
| |
22 public: | |
23 virtual void OnOptionsInitialized() = 0; | |
24 virtual void OnOptionAdded(int index) = 0; | |
25 virtual void OnOptionRemoved(int index) = 0; | |
26 | |
27 protected: | |
28 virtual ~Observer() {} | |
29 }; | |
30 | |
31 virtual const std::vector<base::string16>& GetOptions() const = 0; | |
32 virtual void Select(int index) = 0; | |
33 | |
34 void set_observer(Observer* observer) { observer_ = observer; } | |
35 Observer* observer() const { return observer_; } | |
36 | |
37 private: | |
38 Observer* observer_ = nullptr; | |
39 DISALLOW_COPY_AND_ASSIGN(ChooserOptions); | |
40 }; | |
41 | |
42 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_OPTIONS_H_ | |
OLD | NEW |