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

Unified 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, 2 months 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 side-by-side diff with in-line comments
Download patch
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..5d1f37742fbb91e1d8abcac4a4dea7493cdee615
--- /dev/null
+++ b/chrome/browser/ui/website_settings/chooser_choices.h
@@ -0,0 +1,43 @@
+// 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 {
+ public:
+ ChooserChoices() {}
+ virtual ~ChooserChoices() {}
+
+ class Observer {
+ public:
+ virtual void OnChoicesChanged() = 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_; }
+
+ int RecentlyUpdatedIndex() { return recently_updated_index_; }
+
+ protected:
+ int recently_updated_index_ = -1;
+
+ private:
+ Observer* observer_ = nullptr;
+ DISALLOW_COPY_AND_ASSIGN(ChooserChoices);
+};
+
+#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_CHOICES_H_

Powered by Google App Engine
This is Rietveld 408576698