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

Side by Side Diff: chrome/browser/cocoa/notifications/balloon_controller.mm

Issue 2915003: position the balloons after closing in a way that will keep the next one's cl... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 months 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 | « no previous file | chrome/browser/gtk/notifications/balloon_view_gtk.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/cocoa/notifications/balloon_controller.h" 5 #include "chrome/browser/cocoa/notifications/balloon_controller.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #import "base/cocoa_protocols_mac.h" 9 #import "base/cocoa_protocols_mac.h"
10 #import "base/scoped_nsobject.h" 10 #import "base/scoped_nsobject.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 DCHECK(balloon_); 87 DCHECK(balloon_);
88 [self close]; 88 [self close];
89 if (htmlContents_.get()) 89 if (htmlContents_.get())
90 htmlContents_->Shutdown(); 90 htmlContents_->Shutdown();
91 balloon_->OnClose(byUser); 91 balloon_->OnClose(byUser);
92 balloon_ = NULL; 92 balloon_ = NULL;
93 } 93 }
94 94
95 - (void)repositionToBalloon { 95 - (void)repositionToBalloon {
96 DCHECK(balloon_); 96 DCHECK(balloon_);
97 int x = balloon_->position().x(); 97 int x = balloon_->GetPosition().x();
98 int y = balloon_->position().y(); 98 int y = balloon_->GetPosition().y();
99 int w = [self desiredTotalWidth]; 99 int w = [self desiredTotalWidth];
100 int h = [self desiredTotalHeight]; 100 int h = [self desiredTotalHeight];
101 101
102 htmlContents_->UpdateActualSize(balloon_->content_size()); 102 htmlContents_->UpdateActualSize(balloon_->content_size());
103 [[self window] setFrame:NSMakeRect(x, y, w, h) 103 [[self window] setFrame:NSMakeRect(x, y, w, h)
104 display:YES 104 display:YES
105 animate:YES]; 105 animate:YES];
106 } 106 }
107 107
108 // Returns the total width the view should be to accommodate the balloon. 108 // Returns the total width the view should be to accommodate the balloon.
(...skipping 18 matching lines...) Expand all
127 htmlContents_.reset(new BalloonViewHost(balloon_)); 127 htmlContents_.reset(new BalloonViewHost(balloon_));
128 htmlContents_->Init(); 128 htmlContents_->Init();
129 } 129 }
130 130
131 // NSWindowDelegate notification. 131 // NSWindowDelegate notification.
132 - (void)windowWillClose:(NSNotification*)notif { 132 - (void)windowWillClose:(NSNotification*)notif {
133 [self autorelease]; 133 [self autorelease];
134 } 134 }
135 135
136 @end 136 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/notifications/balloon_view_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698