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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 TabContents* BalloonHost::GetAssociatedTabContents() const { | 59 TabContents* BalloonHost::GetAssociatedTabContents() const { |
60 return NULL; | 60 return NULL; |
61 } | 61 } |
62 | 62 |
63 const string16& BalloonHost::GetSource() const { | 63 const string16& BalloonHost::GetSource() const { |
64 return balloon_->notification().display_source(); | 64 return balloon_->notification().display_source(); |
65 } | 65 } |
66 | 66 |
67 WebPreferences BalloonHost::GetWebkitPrefs() { | 67 WebPreferences BalloonHost::GetWebkitPrefs() { |
68 WebPreferences web_prefs = | 68 WebPreferences web_prefs = |
69 RenderViewHostDelegateHelper::GetWebkitPrefs(balloon_->profile(), | 69 RenderViewHostDelegateHelper::GetWebkitPrefs(render_view_host_); |
70 enable_web_ui_); | |
71 web_prefs.allow_scripts_to_close_windows = true; | 70 web_prefs.allow_scripts_to_close_windows = true; |
72 return web_prefs; | 71 return web_prefs; |
73 } | 72 } |
74 | 73 |
75 const GURL& BalloonHost::GetURL() const { | 74 const GURL& BalloonHost::GetURL() const { |
76 return balloon_->notification().content_url(); | 75 return balloon_->notification().content_url(); |
77 } | 76 } |
78 | 77 |
79 void BalloonHost::Close(RenderViewHost* render_view_host) { | 78 void BalloonHost::Close(RenderViewHost* render_view_host) { |
80 balloon_->CloseByScript(); | 79 balloon_->CloseByScript(); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 should_notify_on_disconnect_ = false; | 209 should_notify_on_disconnect_ = false; |
211 content::NotificationService::current()->Notify( | 210 content::NotificationService::current()->Notify( |
212 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 211 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
213 content::Source<BalloonHost>(this), | 212 content::Source<BalloonHost>(this), |
214 content::NotificationService::NoDetails()); | 213 content::NotificationService::NoDetails()); |
215 } | 214 } |
216 | 215 |
217 bool BalloonHost::IsRenderViewReady() const { | 216 bool BalloonHost::IsRenderViewReady() const { |
218 return should_notify_on_disconnect_; | 217 return should_notify_on_disconnect_; |
219 } | 218 } |
OLD | NEW |