Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/ui/website_settings/chooser_choices.h

Issue 1408193003: Add chrome side webusb permission UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated code to use ScopedPtrMap, added #ifdef for mobile platforms Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698