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

Side by Side Diff: chrome/browser/ui/views/simple_message_box_views.cc

Issue 9958152: Consolidate win/x dispatchers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync, addressed comments Created 8 years, 8 months 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 | Annotate | Revision Log
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 #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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/simple_message_box_views.h ('k') | chrome/browser/ui/views/user_data_dir_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698