OLD | NEW |
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 #include "chrome/browser/ui/views/simple_message_box_views.h" | 5 #include "chrome/browser/ui/views/simple_message_box_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/simple_message_box.h" | 9 #include "chrome/browser/simple_message_box.h" |
10 #include "chrome/browser/ui/dialog_style.h" | 10 #include "chrome/browser/ui/dialog_style.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 string16()); | 142 string16()); |
143 views::Widget::CreateWindowWithParent(this, parent_window)->Show(); | 143 views::Widget::CreateWindowWithParent(this, parent_window)->Show(); |
144 | 144 |
145 // Add reference to be released in DeleteDelegate(). | 145 // Add reference to be released in DeleteDelegate(). |
146 AddRef(); | 146 AddRef(); |
147 } | 147 } |
148 | 148 |
149 SimpleMessageBoxViews::~SimpleMessageBoxViews() { | 149 SimpleMessageBoxViews::~SimpleMessageBoxViews() { |
150 } | 150 } |
151 | 151 |
| 152 bool SimpleMessageBoxViews::Dispatch(const base::NativeEvent& event) { |
152 #if defined(OS_WIN) | 153 #if defined(OS_WIN) |
153 bool SimpleMessageBoxViews::Dispatch(const MSG& msg) { | 154 TranslateMessage(&event); |
154 TranslateMessage(&msg); | 155 DispatchMessage(&event); |
155 DispatchMessage(&msg); | 156 #elif defined(USE_AURA) |
| 157 aura::Env::GetInstance()->GetDispatcher()->Dispatch(event); |
| 158 #endif |
156 return disposition_ == DISPOSITION_UNKNOWN; | 159 return disposition_ == DISPOSITION_UNKNOWN; |
157 } | 160 } |
158 #elif defined(USE_AURA) | |
159 base::MessagePumpDispatcher::DispatchStatus | |
160 SimpleMessageBoxViews::Dispatch(XEvent* xev) { | |
161 if (!aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev)) | |
162 return EVENT_IGNORED; | |
163 | |
164 if (disposition_ == DISPOSITION_UNKNOWN) | |
165 return base::MessagePumpDispatcher::EVENT_PROCESSED; | |
166 return base::MessagePumpDispatcher::EVENT_QUIT; | |
167 } | |
168 #endif | |
OLD | NEW |