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 { |
| 15 public: |
| 16 ChooserChoices() {} |
| 17 virtual ~ChooserChoices() {} |
| 18 |
| 19 class Observer { |
| 20 public: |
| 21 virtual void OnChoicesChanged() = 0; |
| 22 |
| 23 protected: |
| 24 virtual ~Observer() {} |
| 25 }; |
| 26 |
| 27 virtual const std::vector<std::string>& GetChoices() const = 0; |
| 28 virtual void Select(int index) = 0; |
| 29 |
| 30 void set_observer(Observer* observer) { observer_ = observer; } |
| 31 Observer* observer() const { return observer_; } |
| 32 |
| 33 int RecentlyUpdatedIndex() { return recently_updated_index_; } |
| 34 |
| 35 protected: |
| 36 int recently_updated_index_ = -1; |
| 37 |
| 38 private: |
| 39 Observer* observer_ = nullptr; |
| 40 DISALLOW_COPY_AND_ASSIGN(ChooserChoices); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_ |
OLD | NEW |