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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 } | 158 } |
159 | 159 |
160 void BalloonHost::UpdatePreferredSize(const gfx::Size& new_size) { | 160 void BalloonHost::UpdatePreferredSize(const gfx::Size& new_size) { |
161 balloon_->SetContentPreferredSize(new_size); | 161 balloon_->SetContentPreferredSize(new_size); |
162 } | 162 } |
163 | 163 |
164 void BalloonHost::HandleMouseDown() { | 164 void BalloonHost::HandleMouseDown() { |
165 balloon_->OnClick(); | 165 balloon_->OnClick(); |
166 } | 166 } |
167 | 167 |
168 RendererPreferences BalloonHost::GetRendererPrefs(Profile* profile) const { | 168 RendererPreferences BalloonHost::GetRendererPrefs( |
| 169 content::BrowserContext* browser_context) const { |
| 170 Profile* profile = Profile::FromBrowserContext(browser_context); |
169 RendererPreferences preferences; | 171 RendererPreferences preferences; |
170 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); | 172 renderer_preferences_util::UpdateFromSystemSettings(&preferences, profile); |
171 return preferences; | 173 return preferences; |
172 } | 174 } |
173 | 175 |
174 void BalloonHost::Init() { | 176 void BalloonHost::Init() { |
175 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; | 177 DCHECK(!render_view_host_) << "BalloonViewHost already initialized."; |
176 RenderViewHost* rvh = new RenderViewHost( | 178 RenderViewHost* rvh = new RenderViewHost( |
177 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); | 179 site_instance_.get(), this, MSG_ROUTING_NONE, NULL); |
178 if (enable_web_ui_) | 180 if (enable_web_ui_) |
(...skipping 27 matching lines...) Expand all Loading... |
206 | 208 |
207 should_notify_on_disconnect_ = false; | 209 should_notify_on_disconnect_ = false; |
208 NotificationService::current()->Notify( | 210 NotificationService::current()->Notify( |
209 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 211 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
210 Source<BalloonHost>(this), NotificationService::NoDetails()); | 212 Source<BalloonHost>(this), NotificationService::NoDetails()); |
211 } | 213 } |
212 | 214 |
213 bool BalloonHost::IsRenderViewReady() const { | 215 bool BalloonHost::IsRenderViewReady() const { |
214 return should_notify_on_disconnect_; | 216 return should_notify_on_disconnect_; |
215 } | 217 } |
OLD | NEW |