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

Unified Diff: chrome/browser/ui/views/chooser_content_view.h

Issue 2029863002: Refactor ChooserBubbleUiViewDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make ChooserContentView::ChooserControllerDestroying a private function Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/chooser_content_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chooser_content_view.h
diff --git a/chrome/browser/ui/views/chooser_content_view.h b/chrome/browser/ui/views/chooser_content_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..75df792dc0222ecb8dbc10829a15e9e3e64d254a
--- /dev/null
+++ b/chrome/browser/ui/views/chooser_content_view.h
@@ -0,0 +1,63 @@
+// Copyright 2016 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_VIEWS_CHOOSER_CONTENT_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "ui/base/ui_base_types.h"
+#include "ui/views/view.h"
+
+class ChooserController;
+class ChooserTableModel;
+
+namespace ui {
+class TableModel;
+}
+
+namespace views {
+class StyledLabel;
+class StyledLabelListener;
+class TableView;
+class TableViewObserver;
+}
+
+// A bubble or dialog view for choosing among several options in a table.
+// Used for WebUSB/WebBluetooth device selection for Chrome and extensions.
+class ChooserContentView : public views::View {
+ public:
+ ChooserContentView(views::TableViewObserver* observer,
+ ChooserController* chooser_controller);
+ ~ChooserContentView() override;
+
+ // views::View:
+ gfx::Size GetPreferredSize() const override;
+
+ base::string16 GetDialogButtonLabel(ui::DialogButton button) const;
+ bool IsDialogButtonEnabled(ui::DialogButton button) const;
+ // Ownership of the view is passed to the caller.
+ views::StyledLabel* CreateFootnoteView(
+ views::StyledLabelListener* listener) const;
+ void Accept();
+ void Cancel();
+ void Close();
+ void StyledLabelLinkClicked() const;
+ void UpdateTableModel();
+
+ views::TableView* table_view_for_test() const { return table_view_; }
+
+ private:
+ void ChooserControllerDestroying();
+
+ ChooserController* chooser_controller_; // Weak.
+ views::TableView* table_view_;
+ std::unique_ptr<ChooserTableModel> chooser_table_model_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChooserContentView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_
« no previous file with comments | « no previous file | chrome/browser/ui/views/chooser_content_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698