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/bubble/bubble.h" | 5 #include "chrome/browser/ui/views/bubble/bubble.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "chrome/browser/ui/views/bubble/border_contents.h" | 9 #include "chrome/browser/ui/views/bubble/border_contents.h" |
| 10 #include "chrome/common/chrome_notification_types.h" |
10 #include "content/common/notification_service.h" | 11 #include "content/common/notification_service.h" |
11 #include "ui/base/animation/slide_animation.h" | 12 #include "ui/base/animation/slide_animation.h" |
12 #include "ui/base/keycodes/keyboard_codes.h" | 13 #include "ui/base/keycodes/keyboard_codes.h" |
13 #include "ui/gfx/color_utils.h" | 14 #include "ui/gfx/color_utils.h" |
14 #include "views/layout/fill_layout.h" | 15 #include "views/layout/fill_layout.h" |
15 #include "views/widget/widget.h" | 16 #include "views/widget/widget.h" |
16 #include "views/window/client_view.h" | 17 #include "views/window/client_view.h" |
17 | 18 |
18 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
19 #include "chrome/browser/chromeos/wm_ipc.h" | 20 #include "chrome/browser/chromeos/wm_ipc.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 267 |
267 // |contents_view| has no layout manager, so we have to explicitly position | 268 // |contents_view| has no layout manager, so we have to explicitly position |
268 // its children. | 269 // its children. |
269 border_contents_->SetBoundsRect( | 270 border_contents_->SetBoundsRect( |
270 gfx::Rect(gfx::Point(), window_bounds.size())); | 271 gfx::Rect(gfx::Point(), window_bounds.size())); |
271 contents->SetBoundsRect(contents_bounds); | 272 contents->SetBoundsRect(contents_bounds); |
272 #endif | 273 #endif |
273 GetWidget()->SetBounds(window_bounds); | 274 GetWidget()->SetBounds(window_bounds); |
274 | 275 |
275 // Done creating the bubble. | 276 // Done creating the bubble. |
276 NotificationService::current()->Notify(NotificationType::INFO_BUBBLE_CREATED, | 277 NotificationService::current()->Notify( |
277 Source<Bubble>(this), | 278 chrome::NOTIFICATION_INFO_BUBBLE_CREATED, Source<Bubble>(this), |
278 NotificationService::NoDetails()); | 279 NotificationService::NoDetails()); |
279 | 280 |
280 // Show the window. | 281 // Show the window. |
281 #if defined(OS_WIN) | 282 #if defined(OS_WIN) |
282 border_->ShowWindow(SW_SHOW); | 283 border_->ShowWindow(SW_SHOW); |
283 ShowWindow(SW_SHOW); | 284 ShowWindow(SW_SHOW); |
284 if (fade_in) | 285 if (fade_in) |
285 FadeIn(); | 286 FadeIn(); |
286 #elif defined(TOOLKIT_USES_GTK) | 287 #elif defined(TOOLKIT_USES_GTK) |
287 GetWidget()->Show(); | 288 GetWidget()->Show(); |
288 #endif | 289 #endif |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 animation_->Hide(); | 394 animation_->Hide(); |
394 } | 395 } |
395 | 396 |
396 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { | 397 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { |
397 if (!delegate_ || delegate_->CloseOnEscape()) { | 398 if (!delegate_ || delegate_->CloseOnEscape()) { |
398 DoClose(true); | 399 DoClose(true); |
399 return true; | 400 return true; |
400 } | 401 } |
401 return false; | 402 return false; |
402 } | 403 } |
OLD | NEW |