OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SIMPLE_MESSAGE_BOX_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_SIMPLE_MESSAGE_BOX_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_SIMPLE_MESSAGE_BOX_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_SIMPLE_MESSAGE_BOX_VIEWS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Overridden from views::WidgetDelegate: | 55 // Overridden from views::WidgetDelegate: |
56 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 56 virtual bool ShouldShowWindowTitle() const OVERRIDE; |
57 virtual string16 GetWindowTitle() const OVERRIDE; | 57 virtual string16 GetWindowTitle() const OVERRIDE; |
58 virtual void DeleteDelegate() OVERRIDE; | 58 virtual void DeleteDelegate() OVERRIDE; |
59 virtual bool IsModal() const OVERRIDE; | 59 virtual bool IsModal() const OVERRIDE; |
60 virtual views::View* GetContentsView() OVERRIDE; | 60 virtual views::View* GetContentsView() OVERRIDE; |
61 virtual views::Widget* GetWidget() OVERRIDE; | 61 virtual views::Widget* GetWidget() OVERRIDE; |
62 virtual const views::Widget* GetWidget() const OVERRIDE; | 62 virtual const views::Widget* GetWidget() const OVERRIDE; |
63 | 63 |
64 private: | 64 private: |
| 65 enum DialogType { |
| 66 DIALOG_ERROR, |
| 67 DIALOG_YES_NO, |
| 68 }; |
| 69 |
65 SimpleMessageBoxViews(gfx::NativeWindow parent_window, | 70 SimpleMessageBoxViews(gfx::NativeWindow parent_window, |
66 int dialog_flags, | 71 DialogType type, |
67 const string16& title, | 72 const string16& title, |
68 const string16& message); | 73 const string16& message); |
69 virtual ~SimpleMessageBoxViews(); | 74 virtual ~SimpleMessageBoxViews(); |
70 | 75 |
71 // MessageLoop::Dispatcher implementation. | 76 // MessageLoop::Dispatcher implementation. |
72 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
73 // Dispatcher method. This returns true if the menu was canceled, or | 78 // Dispatcher method. This returns true if the menu was canceled, or |
74 // if the message is such that the menu should be closed. | 79 // if the message is such that the menu should be closed. |
75 virtual bool Dispatch(const MSG& msg) OVERRIDE; | 80 virtual bool Dispatch(const MSG& msg) OVERRIDE; |
76 #elif defined(USE_AURA) | 81 #elif defined(USE_AURA) |
77 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( | 82 virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( |
78 XEvent* xevent) OVERRIDE; | 83 XEvent* xevent) OVERRIDE; |
79 #else | 84 #else |
80 virtual bool Dispatch(GdkEvent* event) OVERRIDE; | 85 virtual bool Dispatch(GdkEvent* event) OVERRIDE; |
81 #endif | 86 #endif |
82 | 87 |
83 int dialog_flags_; | 88 const DialogType type_; |
84 string16 message_box_title_; | 89 string16 message_box_title_; |
85 views::MessageBoxView* message_box_view_; | 90 views::MessageBoxView* message_box_view_; |
86 DispositionType disposition_; | 91 DispositionType disposition_; |
87 | 92 |
88 DISALLOW_COPY_AND_ASSIGN(SimpleMessageBoxViews); | 93 DISALLOW_COPY_AND_ASSIGN(SimpleMessageBoxViews); |
89 }; | 94 }; |
90 | 95 |
91 #endif // CHROME_BROWSER_UI_VIEWS_SIMPLE_MESSAGE_BOX_VIEWS_H_ | 96 #endif // CHROME_BROWSER_UI_VIEWS_SIMPLE_MESSAGE_BOX_VIEWS_H_ |
OLD | NEW |