OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/notifications/balloon_view.h" | 5 #include "chrome/browser/views/notifications/balloon_view.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 // one window to the user. | 308 // one window to the user. |
309 gfx::Rect contents_rect = GetContentsRectangle(); | 309 gfx::Rect contents_rect = GetContentsRectangle(); |
310 html_contents_ = new BalloonViewHost(balloon); | 310 html_contents_ = new BalloonViewHost(balloon); |
311 html_contents_->SetPreferredSize(gfx::Size(10000, 10000)); | 311 html_contents_->SetPreferredSize(gfx::Size(10000, 10000)); |
312 | 312 |
313 html_container_ = Widget::CreatePopupWidget(Widget::NotTransparent, | 313 html_container_ = Widget::CreatePopupWidget(Widget::NotTransparent, |
314 Widget::AcceptEvents, | 314 Widget::AcceptEvents, |
315 Widget::DeleteOnDestroy); | 315 Widget::DeleteOnDestroy); |
316 html_container_->SetAlwaysOnTop(true); | 316 html_container_->SetAlwaysOnTop(true); |
317 html_container_->Init(NULL, contents_rect); | 317 html_container_->Init(NULL, contents_rect); |
318 html_container_->SetContentsView(html_contents_); | 318 html_container_->SetContentsView(html_contents_->view()); |
319 | 319 |
320 gfx::Rect balloon_rect(x(), y(), width(), height()); | 320 gfx::Rect balloon_rect(x(), y(), width(), height()); |
321 frame_container_ = Widget::CreatePopupWidget(Widget::Transparent, | 321 frame_container_ = Widget::CreatePopupWidget(Widget::Transparent, |
322 Widget::AcceptEvents, | 322 Widget::AcceptEvents, |
323 Widget::DeleteOnDestroy); | 323 Widget::DeleteOnDestroy); |
324 frame_container_->SetWidgetDelegate(this); | 324 frame_container_->SetWidgetDelegate(this); |
325 frame_container_->SetAlwaysOnTop(true); | 325 frame_container_->SetAlwaysOnTop(true); |
326 frame_container_->Init(NULL, balloon_rect); | 326 frame_container_->Init(NULL, balloon_rect); |
327 frame_container_->SetContentsView(this); | 327 frame_container_->SetContentsView(this); |
328 | 328 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 NOTREACHED(); | 496 NOTREACHED(); |
497 return; | 497 return; |
498 } | 498 } |
499 | 499 |
500 // If the renderer process attached to this balloon is disconnected | 500 // If the renderer process attached to this balloon is disconnected |
501 // (e.g., because of a crash), we want to close the balloon. | 501 // (e.g., because of a crash), we want to close the balloon. |
502 notification_registrar_.Remove(this, | 502 notification_registrar_.Remove(this, |
503 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); | 503 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); |
504 Close(false); | 504 Close(false); |
505 } | 505 } |
OLD | NEW |