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/cocoa/notifications/balloon_controller.h" | 5 #include "chrome/browser/ui/cocoa/notifications/balloon_controller.h" |
6 | 6 |
7 #import "base/mac/cocoa_protocols.h" | 7 #import "base/mac/cocoa_protocols.h" |
8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
9 #import "base/memory/scoped_nsobject.h" | 9 #import "base/memory/scoped_nsobject.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 delayedClose_ = YES; | 170 delayedClose_ = YES; |
171 return; | 171 return; |
172 } | 172 } |
173 [self closeBalloonNow: byUser]; | 173 [self closeBalloonNow: byUser]; |
174 } | 174 } |
175 | 175 |
176 - (void)updateContents { | 176 - (void)updateContents { |
177 DCHECK(htmlContents_.get()) << "BalloonView::Update called before Show"; | 177 DCHECK(htmlContents_.get()) << "BalloonView::Update called before Show"; |
178 if (htmlContents_->tab_contents()) { | 178 if (htmlContents_->tab_contents()) { |
179 htmlContents_->tab_contents()->controller().LoadURL( | 179 htmlContents_->tab_contents()->controller().LoadURL( |
180 balloon_->notification().content_url(), GURL(), | 180 balloon_->notification().content_url(), content::Referrer(), |
181 content::PAGE_TRANSITION_LINK, std::string()); | 181 content::PAGE_TRANSITION_LINK, std::string()); |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 - (void)repositionToBalloon { | 185 - (void)repositionToBalloon { |
186 DCHECK(balloon_); | 186 DCHECK(balloon_); |
187 int x = balloon_->GetPosition().x(); | 187 int x = balloon_->GetPosition().x(); |
188 int y = balloon_->GetPosition().y(); | 188 int y = balloon_->GetPosition().y(); |
189 int w = [self desiredTotalWidth]; | 189 int w = [self desiredTotalWidth]; |
190 int h = [self desiredTotalHeight]; | 190 int h = [self desiredTotalHeight]; |
(...skipping 26 matching lines...) Expand all Loading... |
217 htmlContents_.reset(new BalloonViewHost(balloon_)); | 217 htmlContents_.reset(new BalloonViewHost(balloon_)); |
218 htmlContents_->Init(); | 218 htmlContents_->Init(); |
219 } | 219 } |
220 | 220 |
221 // NSWindowDelegate notification. | 221 // NSWindowDelegate notification. |
222 - (void)windowWillClose:(NSNotification*)notif { | 222 - (void)windowWillClose:(NSNotification*)notif { |
223 [self autorelease]; | 223 [self autorelease]; |
224 } | 224 } |
225 | 225 |
226 @end | 226 @end |
OLD | NEW |