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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/views/controls/link_listener.h"
11 #include "ui/views/window/dialog_delegate.h"
13 class ConfirmBubbleModel
;
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:
17 // +------------------------+
20 // | Link [OK] [Cancel] |
21 // +------------------------+
23 // TODO(msw): Remove this class or merge it with DialogDelegateView.
24 class ConfirmBubbleViews
: public views::DialogDelegateView
,
25 public views::LinkListener
{
27 explicit ConfirmBubbleViews(ConfirmBubbleModel
* model
);
30 virtual ~ConfirmBubbleViews();
32 // views::DialogDelegate implementation.
33 virtual base::string16
GetDialogButtonLabel(
34 ui::DialogButton button
) const OVERRIDE
;
35 virtual bool IsDialogButtonEnabled(ui::DialogButton button
) const OVERRIDE
;
36 virtual views::View
* CreateExtraView() OVERRIDE
;
37 virtual bool Cancel() OVERRIDE
;
38 virtual bool Accept() OVERRIDE
;
40 // views::WidgetDelegate implementation.
41 virtual ui::ModalType
GetModalType() const OVERRIDE
;
42 virtual base::string16
GetWindowTitle() const OVERRIDE
;
44 // views::LinkListener implementation.
45 virtual void LinkClicked(views::Link
* source
, int event_flags
) OVERRIDE
;
48 // The model to customize this bubble view.
49 scoped_ptr
<ConfirmBubbleModel
> model_
;
53 DISALLOW_COPY_AND_ASSIGN(ConfirmBubbleViews
);
56 #endif // CHROME_BROWSER_UI_VIEWS_CONFIRM_BUBBLE_VIEWS_H_