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

Side by Side Diff: chrome/browser/ui/views/extensions/chooser_dialog_view.h

Issue 2478863003: Fix the Web Bluetooth chooser when it is used on Chrome apps on non-Mac (Closed)
Patch Set: updated ChooserDialogViewTest Created 4 years, 1 month 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_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/views/controls/table/table_view_observer.h" 11 #include "ui/views/controls/table/table_view_observer.h"
12 #include "ui/views/window/dialog_delegate.h" 12 #include "ui/views/window/dialog_delegate.h"
13 13
14 namespace views {
15 class StyledLabel;
16 }
17
14 class ChooserContentView; 18 class ChooserContentView;
15 class ChooserController; 19 class ChooserController;
16 20
17 // Displays a chooser view as a modal dialog constrained 21 // Displays a chooser view as a modal dialog constrained
18 // to the window/tab displaying the given web contents. 22 // to the window/tab displaying the given web contents.
19 class ChooserDialogView : public views::DialogDelegateView, 23 class ChooserDialogView : public views::DialogDelegateView,
20 public views::TableViewObserver { 24 public views::TableViewObserver {
21 public: 25 public:
22 explicit ChooserDialogView( 26 explicit ChooserDialogView(
23 std::unique_ptr<ChooserController> chooser_controller); 27 std::unique_ptr<ChooserController> chooser_controller);
24 ~ChooserDialogView() override; 28 ~ChooserDialogView() override;
25 29
26 // views::WidgetDelegate: 30 // views::WidgetDelegate:
27 base::string16 GetWindowTitle() const override; 31 base::string16 GetWindowTitle() const override;
28 bool ShouldShowCloseButton() const override; 32 bool ShouldShowCloseButton() const override;
29 ui::ModalType GetModalType() const override; 33 ui::ModalType GetModalType() const override;
30 34
31 // views::DialogDelegate: 35 // views::DialogDelegate:
32 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; 36 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
33 bool IsDialogButtonEnabled(ui::DialogButton button) const override; 37 bool IsDialogButtonEnabled(ui::DialogButton button) const override;
34 views::View* CreateFootnoteView() override; 38 views::View* CreateFootnoteView() override;
39 views::ClientView* CreateClientView(views::Widget* widget) override;
40 views::NonClientFrameView* CreateNonClientFrameView(
41 views::Widget* widget) override;
35 bool Accept() override; 42 bool Accept() override;
36 bool Cancel() override; 43 bool Cancel() override;
37 bool Close() override; 44 bool Close() override;
38 45
39 // views::DialogDelegateView: 46 // views::DialogDelegateView:
40 views::View* GetContentsView() override; 47 views::View* GetContentsView() override;
41 views::Widget* GetWidget() override; 48 views::Widget* GetWidget() override;
42 const views::Widget* GetWidget() const override; 49 const views::Widget* GetWidget() const override;
43 50
44 // views::TableViewObserver: 51 // views::TableViewObserver:
45 void OnSelectionChanged() override; 52 void OnSelectionChanged() override;
46 53
47 ChooserContentView* chooser_content_view_for_test() const; 54 ChooserContentView* chooser_content_view_for_test() const;
48 55
49 private: 56 private:
57 // |footnote_link_| will transfer its ownership of the pointer to its
58 // caller when CreateFootnoteView() is called.
59 std::unique_ptr<views::StyledLabel> footnote_link_;
50 ChooserContentView* chooser_content_view_; 60 ChooserContentView* chooser_content_view_;
51 61
52 DISALLOW_COPY_AND_ASSIGN(ChooserDialogView); 62 DISALLOW_COPY_AND_ASSIGN(ChooserDialogView);
53 }; 63 };
54 64
55 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_ 65 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_CHOOSER_DIALOG_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698