Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome/browser/views/notifications/balloon_view.cc

Issue 342116: Attempt 2 at:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/find_bar_host_win.cc ('k') | views/view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/views/find_bar_host_win.cc ('k') | views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698