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

Side by Side Diff: chrome/browser/ui/views/chooser_content_view.h

Issue 2086663003: Change ChooserController ownership model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed some Cocoa function names to start with lowercase letter 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 13 matching lines...) Expand all
24 class StyledLabelListener; 24 class StyledLabelListener;
25 class TableView; 25 class TableView;
26 class TableViewObserver; 26 class TableViewObserver;
27 } 27 }
28 28
29 // A bubble or dialog view for choosing among several options in a table. 29 // A bubble or dialog view for choosing among several options in a table.
30 // Used for WebUSB/WebBluetooth device selection for Chrome and extensions. 30 // Used for WebUSB/WebBluetooth device selection for Chrome and extensions.
31 class ChooserContentView : public views::View { 31 class ChooserContentView : public views::View {
32 public: 32 public:
33 ChooserContentView(views::TableViewObserver* observer, 33 ChooserContentView(views::TableViewObserver* observer,
34 ChooserController* chooser_controller); 34 std::unique_ptr<ChooserController> chooser_controller);
35 ~ChooserContentView() override; 35 ~ChooserContentView() override;
36 36
37 // views::View: 37 // views::View:
38 gfx::Size GetPreferredSize() const override; 38 gfx::Size GetPreferredSize() const override;
39 39
40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const; 40 base::string16 GetDialogButtonLabel(ui::DialogButton button) const;
41 bool IsDialogButtonEnabled(ui::DialogButton button) const; 41 bool IsDialogButtonEnabled(ui::DialogButton button) const;
42 // Ownership of the view is passed to the caller. 42 // Ownership of the view is passed to the caller.
43 views::StyledLabel* CreateFootnoteView( 43 views::StyledLabel* CreateFootnoteView(
44 views::StyledLabelListener* listener) const; 44 views::StyledLabelListener* listener) const;
45 void Accept(); 45 void Accept();
46 void Cancel(); 46 void Cancel();
47 void Close(); 47 void Close();
48 void StyledLabelLinkClicked() const; 48 void StyledLabelLinkClicked();
49 void UpdateTableModel(); 49 void UpdateTableModel();
50 50
51 views::TableView* table_view_for_test() const { return table_view_; } 51 views::TableView* table_view_for_test() const { return table_view_; }
52 52
53 private: 53 private:
54 void ChooserControllerDestroying(); 54 std::unique_ptr<ChooserController> chooser_controller_;
55 55 std::unique_ptr<ChooserTableModel> chooser_table_model_;
56 ChooserController* chooser_controller_; // Weak.
57 views::TableView* table_view_; 56 views::TableView* table_view_;
58 std::unique_ptr<ChooserTableModel> chooser_table_model_;
59 57
60 DISALLOW_COPY_AND_ASSIGN(ChooserContentView); 58 DISALLOW_COPY_AND_ASSIGN(ChooserContentView);
61 }; 59 };
62 60
63 #endif // CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_ 61 #endif // CHROME_BROWSER_UI_VIEWS_CHOOSER_CONTENT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698