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_CHOICES_H_ | |
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/macros.h" | |
12 | |
13 // Stores all the available device lists, handle device added/removed, etc. | |
14 class ChooserChoices { | |
Reilly Grant (use Gerrit)
2015/11/12 21:44:36
s/Choice/Option/g and I think these class and meth
juncai
2015/11/14 01:54:36
Done.
| |
15 public: | |
16 ChooserChoices() {} | |
17 virtual ~ChooserChoices() {} | |
18 | |
19 class Observer { | |
20 public: | |
21 virtual void OnChoicesInitialized() = 0; | |
22 virtual void OnChoiceAdded(int index) = 0; | |
23 virtual void OnChoiceRemoved(int index) = 0; | |
24 | |
25 protected: | |
26 virtual ~Observer() {} | |
27 }; | |
28 | |
29 virtual const std::vector<std::string>& GetChoices() const = 0; | |
30 virtual void Select(int index) = 0; | |
31 | |
32 void set_observer(Observer* observer) { observer_ = observer; } | |
33 Observer* observer() const { return observer_; } | |
34 | |
35 private: | |
36 Observer* observer_ = nullptr; | |
37 DISALLOW_COPY_AND_ASSIGN(ChooserChoices); | |
38 }; | |
39 | |
40 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_ | |
OLD | NEW |