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 #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/views/window.h" | 10 #include "chrome/browser/ui/views/window.h" |
11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
12 #include "ui/base/l10n/l10n_util.h" | 12 #include "ui/base/l10n/l10n_util.h" |
13 #include "views/controls/message_box_view.h" | 13 #include "views/controls/message_box_view.h" |
14 #include "views/widget/widget.h" | 14 #include "views/widget/widget.h" |
15 | 15 |
16 #if defined(TOUCH_UI) | 16 #if defined(TOUCH_UI) || defined(USE_AURA) |
17 #include "views/focus/accelerator_handler.h" | 17 #include "views/focus/accelerator_handler.h" |
18 #endif | 18 #endif |
19 | 19 |
20 namespace browser { | 20 namespace browser { |
21 | 21 |
22 void ShowErrorBox(gfx::NativeWindow parent, | 22 void ShowErrorBox(gfx::NativeWindow parent, |
23 const string16& title, | 23 const string16& title, |
24 const string16& message) { | 24 const string16& message) { |
25 SimpleMessageBoxViews::ShowErrorBox(parent, title, message); | 25 SimpleMessageBoxViews::ShowErrorBox(parent, title, message); |
26 } | 26 } |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 148 |
149 SimpleMessageBoxViews::~SimpleMessageBoxViews() { | 149 SimpleMessageBoxViews::~SimpleMessageBoxViews() { |
150 } | 150 } |
151 | 151 |
152 #if defined(OS_WIN) | 152 #if defined(OS_WIN) |
153 bool SimpleMessageBoxViews::Dispatch(const MSG& msg) { | 153 bool SimpleMessageBoxViews::Dispatch(const MSG& msg) { |
154 TranslateMessage(&msg); | 154 TranslateMessage(&msg); |
155 DispatchMessage(&msg); | 155 DispatchMessage(&msg); |
156 return disposition_ == DISPOSITION_UNKNOWN; | 156 return disposition_ == DISPOSITION_UNKNOWN; |
157 } | 157 } |
158 #elif defined(TOUCH_UI) | 158 #elif defined(TOUCH_UI) || defined(USE_AURA) |
159 base::MessagePumpDispatcher::DispatchStatus | 159 base::MessagePumpDispatcher::DispatchStatus |
160 SimpleMessageBoxViews::Dispatch(XEvent* xev) { | 160 SimpleMessageBoxViews::Dispatch(XEvent* xev) { |
161 if (!views::DispatchXEvent(xev)) | 161 if (!views::DispatchXEvent(xev)) |
162 return EVENT_IGNORED; | 162 return EVENT_IGNORED; |
163 | 163 |
164 if (disposition_ == DISPOSITION_UNKNOWN) | 164 if (disposition_ == DISPOSITION_UNKNOWN) |
165 return base::MessagePumpDispatcher::EVENT_PROCESSED; | 165 return base::MessagePumpDispatcher::EVENT_PROCESSED; |
166 return base::MessagePumpDispatcher::EVENT_QUIT; | 166 return base::MessagePumpDispatcher::EVENT_QUIT; |
167 } | 167 } |
168 #else | 168 #else |
169 bool SimpleMessageBoxViews::Dispatch(GdkEvent* event) { | 169 bool SimpleMessageBoxViews::Dispatch(GdkEvent* event) { |
170 gtk_main_do_event(event); | 170 gtk_main_do_event(event); |
171 return disposition_ == DISPOSITION_UNKNOWN; | 171 return disposition_ == DISPOSITION_UNKNOWN; |
172 } | 172 } |
173 #endif | 173 #endif |
OLD | NEW |