Chromium Code Reviews| Index: chrome/browser/ui/website_settings/chooser_options.h |
| diff --git a/chrome/browser/ui/website_settings/chooser_options.h b/chrome/browser/ui/website_settings/chooser_options.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e58cd10f522bbe066e8d99a87d69b01b5d152430 |
| --- /dev/null |
| +++ b/chrome/browser/ui/website_settings/chooser_options.h |
| @@ -0,0 +1,42 @@ |
| +// 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_OPTIONS_H_ |
| +#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_OPTIONS_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/strings/string16.h" |
| + |
| +// 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
|
| +// option added/removed. |
| +class ChooserOptions { |
| + public: |
| + ChooserOptions() {} |
| + virtual ~ChooserOptions() {} |
| + |
| + 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
|
| + public: |
| + virtual void OnOptionsInitialized() = 0; |
| + virtual void OnOptionAdded(int index) = 0; |
| + virtual void OnOptionRemoved(int index) = 0; |
| + |
| + protected: |
| + virtual ~Observer() {} |
| + }; |
| + |
| + virtual const std::vector<base::string16>& GetOptions() 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(ChooserOptions); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_OPTIONS_H_ |