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

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

Issue 801043003: Change ShowConfirmBubble() to take model by scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « chrome/browser/ui/confirm_bubble.h ('k') | chrome/browser/ui/views/confirm_bubble_views.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_CONFIRM_BUBBLE_VIEWS_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_ 6 #define CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ui/views/controls/link_listener.h" 10 #include "ui/views/controls/link_listener.h"
11 #include "ui/views/window/dialog_delegate.h" 11 #include "ui/views/window/dialog_delegate.h"
12 12
13 class ConfirmBubbleModel; 13 class ConfirmBubbleModel;
14 14
15 // A dialog (with the standard Title/(x)/[OK]/[Cancel] UI elements), as well as 15 // A dialog (with the standard Title/(x)/[OK]/[Cancel] UI elements), as well as
16 // a message Label and optional Link. The dialog ultimately appears like this: 16 // a message Label and optional Link. The dialog ultimately appears like this:
17 // +------------------------+ 17 // +------------------------+
18 // | Title (x) | 18 // | Title (x) |
19 // | Label | 19 // | Label |
20 // | Link [OK] [Cancel] | 20 // | Link [OK] [Cancel] |
21 // +------------------------+ 21 // +------------------------+
22 // 22 //
23 // TODO(msw): Remove this class or merge it with DialogDelegateView. 23 // TODO(msw): Remove this class or merge it with DialogDelegateView.
24 class ConfirmBubbleViews : public views::DialogDelegateView, 24 class ConfirmBubbleViews : public views::DialogDelegateView,
25 public views::LinkListener { 25 public views::LinkListener {
26 public: 26 public:
27 explicit ConfirmBubbleViews(ConfirmBubbleModel* model); 27 explicit ConfirmBubbleViews(scoped_ptr<ConfirmBubbleModel> model);
28 28
29 protected: 29 protected:
30 ~ConfirmBubbleViews() override; 30 ~ConfirmBubbleViews() override;
31 31
32 // views::DialogDelegate implementation. 32 // views::DialogDelegate implementation.
33 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override; 33 base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
34 bool IsDialogButtonEnabled(ui::DialogButton button) const override; 34 bool IsDialogButtonEnabled(ui::DialogButton button) const override;
35 views::View* CreateExtraView() override; 35 views::View* CreateExtraView() override;
36 bool Cancel() override; 36 bool Cancel() override;
37 bool Accept() override; 37 bool Accept() override;
38 38
39 // views::WidgetDelegate implementation. 39 // views::WidgetDelegate implementation.
40 ui::ModalType GetModalType() const override; 40 ui::ModalType GetModalType() const override;
41 base::string16 GetWindowTitle() const override; 41 base::string16 GetWindowTitle() const override;
42 42
43 // views::LinkListener implementation. 43 // views::LinkListener implementation.
44 void LinkClicked(views::Link* source, int event_flags) override; 44 void LinkClicked(views::Link* source, int event_flags) override;
45 45
46 private: 46 private:
47 // The model to customize this bubble view. 47 // The model to customize this bubble view.
48 scoped_ptr<ConfirmBubbleModel> model_; 48 scoped_ptr<ConfirmBubbleModel> model_;
49 49
50 views::Link* link_; 50 views::Link* link_;
51 51
52 DISALLOW_COPY_AND_ASSIGN(ConfirmBubbleViews); 52 DISALLOW_COPY_AND_ASSIGN(ConfirmBubbleViews);
53 }; 53 };
54 54
55 #endif // CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_ 55 #endif // CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/confirm_bubble.h ('k') | chrome/browser/ui/views/confirm_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698