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/notifications/balloon_host.h" | 5 #include "chrome/browser/notifications/balloon_host.h" |
6 #include "chrome/browser/notifications/balloon.h" | 6 #include "chrome/browser/notifications/balloon.h" |
7 #include "chrome/browser/notifications/notification.h" | 7 #include "chrome/browser/notifications/notification.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/renderer_preferences_util.h" | 9 #include "chrome/browser/renderer_preferences_util.h" |
10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 166 } |
167 | 167 |
168 void BalloonHost::UpdatePreferredSize(const gfx::Size& new_size) { | 168 void BalloonHost::UpdatePreferredSize(const gfx::Size& new_size) { |
169 balloon_->SetContentPreferredSize(new_size); | 169 balloon_->SetContentPreferredSize(new_size); |
170 } | 170 } |
171 | 171 |
172 void BalloonHost::HandleMouseDown() { | 172 void BalloonHost::HandleMouseDown() { |
173 balloon_->OnClick(); | 173 balloon_->OnClick(); |
174 } | 174 } |
175 | 175 |
176 RendererPreferences BalloonHost::GetRendererPrefs(Profile* profile) const { | 176 RendererPreferences BalloonHost::GetRendererPrefs( |
| 177 content::BrowserContext* context) const { |
| 178 Profile* profile = static_cast<Profile*>(context); |
177 RendererPreferences preferences; | 179 RendererPreferences preferences; |
178 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); | 180 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); |
179 return preferences; | 181 return preferences; |
180 } | 182 } |
181 | 183 |
182 void BalloonHost::Init() { | 184 void BalloonHost::Init() { |
183 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; | 185 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; |
184 RenderViewHost* rvh = new RenderViewHost( | 186 RenderViewHost* rvh = new RenderViewHost( |
185 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); | 187 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); |
186 if (enable_web_ui_) | 188 if (enable_web_ui_) |
(...skipping 27 matching lines...) Expand all Loading... |
214 | 216 |
215 should_notify_on_disconnect_ = false; | 217 should_notify_on_disconnect_ = false; |
216 NotificationService::current()->Notify( | 218 NotificationService::current()->Notify( |
217 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 219 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
218 Source<BalloonHost>(this), NotificationService::NoDetails()); | 220 Source<BalloonHost>(this), NotificationService::NoDetails()); |
219 } | 221 } |
220 | 222 |
221 bool BalloonHost::IsRenderViewReady() const { | 223 bool BalloonHost::IsRenderViewReady() const { |
222 return should_notify_on_disconnect_; | 224 return should_notify_on_disconnect_; |
223 } | 225 } |
OLD | NEW |