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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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_VIEWS_WEBSHARE_TARGET_PICKER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_WEBSHARE_TARGET_PICKER_VIEW_H_
7
8 #include <vector>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/strings/string16.h"
13 #include "ui/base/models/table_model.h"
14 #include "ui/base/ui_base_types.h"
15 #include "ui/views/window/dialog_delegate.h"
16
17 // Dialog that presents the user with a list of share target apps. Allows the
18 // 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
19 //
20 // NOTE: This dialog has *not* been UI-reviewed, and is being used by an
21 // in-development feature (Web Share) behind a runtime flag. It should not be
22 // used by any released code until going through UI review.
23 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.
24 public ui::TableModel {
25 public:
26 explicit WebShareTargetPickerView(
27 const std::vector<base::string16>& targets,
28 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
29 ~WebShareTargetPickerView() override;
30
31 // Initializes the controls in the dialog.
32 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.
33
34 // views::View overrides:
35 gfx::Size GetPreferredSize() const override;
36
37 // views::WidgetDelegate overrides:
38 ui::ModalType GetModalType() const override;
39 base::string16 GetWindowTitle() const override;
40
41 // views::DialogDelegate overrides:
42 bool Cancel() override;
43 bool Accept() override;
44 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
45
46 // ui::TableModel overrides:
47 int RowCount() override;
48 base::string16 GetText(int row, int column_id) override;
49 void SetObserver(ui::TableModelObserver* observer) override;
50
51 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 :)
52 std::vector<base::string16> targets_;
sky 2017/01/23 16:38:55 const
Matt Giuca 2017/01/30 04:07:12 Done.
53
54 base::Callback<void(bool)> close_callback_;
55
56 DISALLOW_COPY_AND_ASSIGN(WebShareTargetPickerView);
57 };
58
59 #endif // CHROME_BROWSER_UI_VIEWS_WEBSHARE_TARGET_PICKER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698