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/chromeos/login/message_bubble.h" | 5 #include "chrome/browser/chromeos/login/message_bubble.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/chromeos/login/helper.h" | 10 #include "chrome/browser/chromeos/login/helper.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 links.push_back(help); | 165 links.push_back(help); |
166 // The bubble will be destroyed when it is closed. | 166 // The bubble will be destroyed when it is closed. |
167 MessageBubble* bubble = new MessageBubble( | 167 MessageBubble* bubble = new MessageBubble( |
168 views::Widget::InitParams::TYPE_CONTROL, parent, image, text, links, | 168 views::Widget::InitParams::TYPE_CONTROL, parent, image, text, links, |
169 false, delegate); | 169 false, delegate); |
170 bubble->InitBubble(parent, position_relative_to, arrow_location, | 170 bubble->InitBubble(parent, position_relative_to, arrow_location, |
171 bubble->text_->parent(), delegate); | 171 bubble->text_->parent(), delegate); |
172 return bubble; | 172 return bubble; |
173 } | 173 } |
174 | 174 |
175 #if !defined(TOUCH_UI) | 175 #if !defined(TOUCH_UI) && !defined(USE_AURA) |
176 void MessageBubble::OnActiveChanged() { | 176 void MessageBubble::OnActiveChanged() { |
177 if (parent_ && IsActive()) { | 177 if (parent_ && IsActive()) { |
178 // Show the parent. | 178 // Show the parent. |
179 gtk_window_present_with_time(parent_->GetNativeWindow(), | 179 gtk_window_present_with_time(parent_->GetNativeWindow(), |
180 gtk_get_current_event_time()); | 180 gtk_get_current_event_time()); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 void MessageBubble::SetMouseCapture() { | 184 void MessageBubble::SetMouseCapture() { |
185 if (grab_enabled_) | 185 if (grab_enabled_) |
186 NativeWidgetGtk::SetMouseCapture(); | 186 NativeWidgetGtk::SetMouseCapture(); |
187 } | 187 } |
188 #endif | 188 #endif |
189 | 189 |
190 void MessageBubble::Close() { | 190 void MessageBubble::Close() { |
191 parent_ = NULL; | 191 parent_ = NULL; |
192 Bubble::Close(); | 192 Bubble::Close(); |
193 } | 193 } |
194 | 194 |
195 #if !defined(TOUCH_UI) | 195 #if !defined(TOUCH_UI) && !defined(USE_AURA) |
196 gboolean MessageBubble::OnButtonPress(GtkWidget* widget, | 196 gboolean MessageBubble::OnButtonPress(GtkWidget* widget, |
197 GdkEventButton* event) { | 197 GdkEventButton* event) { |
198 NativeWidgetGtk::OnButtonPress(widget, event); | 198 NativeWidgetGtk::OnButtonPress(widget, event); |
199 // Never propagate event to parent. | 199 // Never propagate event to parent. |
200 return true; | 200 return true; |
201 } | 201 } |
202 #endif | 202 #endif |
203 | 203 |
204 } // namespace chromeos | 204 } // namespace chromeos |
OLD | NEW |