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

Unified Diff: chrome/browser/ui/views/webshare/target_picker_view.h

Issue 2644793006: Add picker view for Web Share Target. (Closed)
Patch Set: Fix comment. Created 3 years, 11 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/views/webshare/target_picker_view.h
diff --git a/chrome/browser/ui/views/webshare/target_picker_view.h b/chrome/browser/ui/views/webshare/target_picker_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7eeee905223fb00653d493fc0569e3780bf926d
--- /dev/null
+++ b/chrome/browser/ui/views/webshare/target_picker_view.h
@@ -0,0 +1,59 @@
+// Copyright 2017 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_WEBSHARE_TARGET_PICKER_VIEW_H_
+#define CHROME_BROWSER_UI_VIEWS_WEBSHARE_TARGET_PICKER_VIEW_H_
+
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "ui/base/models/table_model.h"
+#include "ui/base/ui_base_types.h"
+#include "ui/views/window/dialog_delegate.h"
+
+// Dialog that presents the user with a list of share target apps. Allows the
+// user to pick one target to be opened and have data passed to it.
sky 2017/01/23 16:38:56 I don't see the selection in the table used in any
Matt Giuca 2017/01/30 04:07:13 We don't yet have the real data about what apps to
+//
+// NOTE: This dialog has *not* been UI-reviewed, and is being used by an
+// in-development feature (Web Share) behind a runtime flag. It should not be
+// used by any released code until going through UI review.
+class WebShareTargetPickerView : public views::DialogDelegateView,
sky 2017/01/23 16:38:55 File name should match class name.
Matt Giuca 2017/01/30 04:07:13 OK, renamed file to webshare_target_picker_view.
+ public ui::TableModel {
+ public:
+ explicit WebShareTargetPickerView(
+ const std::vector<base::string16>& targets,
+ const base::Callback<void(bool)>& close_callback);
sky 2017/01/23 16:38:55 Document what 'close_callback' is and when called.
Matt Giuca 2017/01/30 04:07:12 Done. (Note: It had to be added to browser_dialogs
+ ~WebShareTargetPickerView() override;
+
+ // Initializes the controls in the dialog.
+ void InitControls();
sky 2017/01/23 16:38:55 Make private (or just move into constructor).
Matt Giuca 2017/01/30 04:07:12 Done.
+
+ // views::View overrides:
+ gfx::Size GetPreferredSize() const override;
+
+ // views::WidgetDelegate overrides:
+ ui::ModalType GetModalType() const override;
+ base::string16 GetWindowTitle() const override;
+
+ // views::DialogDelegate overrides:
+ bool Cancel() override;
+ bool Accept() override;
+ base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
+
+ // ui::TableModel overrides:
+ int RowCount() override;
+ base::string16 GetText(int row, int column_id) override;
+ void SetObserver(ui::TableModelObserver* observer) override;
+
+ protected:
sky 2017/01/23 16:38:55 private (see style guide).
Matt Giuca 2017/01/30 04:07:12 Lol whoops, I copypastad this from another file :)
+ std::vector<base::string16> targets_;
sky 2017/01/23 16:38:55 const
Matt Giuca 2017/01/30 04:07:12 Done.
+
+ base::Callback<void(bool)> close_callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebShareTargetPickerView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_WEBSHARE_TARGET_PICKER_VIEW_H_

Powered by Google App Engine
This is Rietveld 408576698