Chromium Code Reviews| Index: chrome/browser/ui/website_settings/chooser_choices.h |
| diff --git a/chrome/browser/ui/website_settings/chooser_choices.h b/chrome/browser/ui/website_settings/chooser_choices.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e6e2f664d67c9b6ce9af6cf4b0e073599a0776ae |
| --- /dev/null |
| +++ b/chrome/browser/ui/website_settings/chooser_choices.h |
| @@ -0,0 +1,40 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_ |
| +#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| + |
| +// Stores all the available device lists, handle device added/removed, etc. |
| +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.
|
| + public: |
| + ChooserChoices() {} |
| + virtual ~ChooserChoices() {} |
| + |
| + class Observer { |
| + public: |
| + virtual void OnChoicesInitialized() = 0; |
| + virtual void OnChoiceAdded(int index) = 0; |
| + virtual void OnChoiceRemoved(int index) = 0; |
| + |
| + protected: |
| + virtual ~Observer() {} |
| + }; |
| + |
| + virtual const std::vector<std::string>& GetChoices() const = 0; |
| + virtual void Select(int index) = 0; |
| + |
| + void set_observer(Observer* observer) { observer_ = observer; } |
| + Observer* observer() const { return observer_; } |
| + |
| + private: |
| + Observer* observer_ = nullptr; |
| + DISALLOW_COPY_AND_ASSIGN(ChooserChoices); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_ |