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/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
10 #include "app/gfx/gdi_util.h" | 10 #include "app/gfx/gdi_util.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void BalloonViewImpl::SizeContentsWindow() { | 130 void BalloonViewImpl::SizeContentsWindow() { |
131 if (!html_container_ || !frame_container_) | 131 if (!html_container_ || !frame_container_) |
132 return; | 132 return; |
133 | 133 |
134 gfx::Rect contents_rect = GetContentsRectangle(); | 134 gfx::Rect contents_rect = GetContentsRectangle(); |
135 html_container_->SetBounds(contents_rect); | 135 html_container_->SetBounds(contents_rect); |
136 html_container_->MoveAbove(frame_container_); | 136 html_container_->MoveAbove(frame_container_); |
137 | 137 |
138 gfx::Path path; | 138 gfx::Path path; |
139 GetContentsMask(contents_rect, &path); | 139 GetContentsMask(contents_rect, &path); |
140 html_container_->SetShape(path); | 140 html_container_->SetShape(path.CreateNativeRegion()); |
141 } | 141 } |
142 | 142 |
143 void BalloonViewImpl::RepositionToBalloon() { | 143 void BalloonViewImpl::RepositionToBalloon() { |
144 DCHECK(frame_container_); | 144 DCHECK(frame_container_); |
145 DCHECK(html_container_); | 145 DCHECK(html_container_); |
146 DCHECK(balloon_); | 146 DCHECK(balloon_); |
147 | 147 |
148 if (!kAnimateEnabled) { | 148 if (!kAnimateEnabled) { |
149 frame_container_->SetBounds( | 149 frame_container_->SetBounds( |
150 gfx::Rect(balloon_->position(), balloon_->size())); | 150 gfx::Rect(balloon_->position(), balloon_->size())); |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 NOTREACHED(); | 345 NOTREACHED(); |
346 return; | 346 return; |
347 } | 347 } |
348 | 348 |
349 // If the renderer process attached to this balloon is disconnected | 349 // If the renderer process attached to this balloon is disconnected |
350 // (e.g., because of a crash), we want to close the balloon. | 350 // (e.g., because of a crash), we want to close the balloon. |
351 notification_registrar_.Remove(this, | 351 notification_registrar_.Remove(this, |
352 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); | 352 NotificationType::NOTIFY_BALLOON_DISCONNECTED, Source<Balloon>(balloon_)); |
353 Close(); | 353 Close(); |
354 } | 354 } |
OLD | NEW |