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 "chrome/common/chrome_notification_types.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 contents_view->AddChildViewAt(border_contents_, 0); | 266 contents_view->AddChildViewAt(border_contents_, 0); |
267 | 267 |
268 // |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 |
269 // its children. | 269 // its children. |
270 border_contents_->SetBoundsRect( | 270 border_contents_->SetBoundsRect( |
271 gfx::Rect(gfx::Point(), window_bounds.size())); | 271 gfx::Rect(gfx::Point(), window_bounds.size())); |
272 contents->SetBoundsRect(contents_bounds); | 272 contents->SetBoundsRect(contents_bounds); |
273 #endif | 273 #endif |
274 GetWidget()->SetBounds(window_bounds); | 274 GetWidget()->SetBounds(window_bounds); |
275 | 275 |
276 // Done creating the bubble. | |
277 NotificationService::current()->Notify( | |
278 chrome::NOTIFICATION_INFO_BUBBLE_CREATED, Source<Bubble>(this), | |
279 NotificationService::NoDetails()); | |
280 | |
281 // Show the window. | 276 // Show the window. |
282 #if defined(OS_WIN) | 277 #if defined(OS_WIN) |
283 border_->ShowWindow(SW_SHOW); | 278 border_->ShowWindow(SW_SHOW); |
284 ShowWindow(SW_SHOW); | 279 ShowWindow(SW_SHOW); |
285 if (fade_in) | 280 if (fade_in) |
286 FadeIn(); | 281 FadeIn(); |
287 #elif defined(TOOLKIT_USES_GTK) | 282 #elif defined(TOOLKIT_USES_GTK) |
288 GetWidget()->Show(); | 283 GetWidget()->Show(); |
289 #endif | 284 #endif |
290 } | 285 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 animation_->Hide(); | 389 animation_->Hide(); |
395 } | 390 } |
396 | 391 |
397 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { | 392 bool Bubble::AcceleratorPressed(const views::Accelerator& accelerator) { |
398 if (!delegate_ || delegate_->CloseOnEscape()) { | 393 if (!delegate_ || delegate_->CloseOnEscape()) { |
399 DoClose(true); | 394 DoClose(true); |
400 return true; | 395 return true; |
401 } | 396 } |
402 return false; | 397 return false; |
403 } | 398 } |
OLD | NEW |