OLD | NEW |
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/notifications/balloon_host.h" | 5 #include "chrome/browser/notifications/balloon_host.h" |
6 | 6 |
7 #include "chrome/browser/browser_list.h" | 7 #include "chrome/browser/browser_list.h" |
8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
9 #include "chrome/browser/notifications/balloon.h" | 9 #include "chrome/browser/notifications/balloon.h" |
10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 TabContents* BalloonHost::associated_tab_contents() const { return NULL; } | 86 TabContents* BalloonHost::associated_tab_contents() const { return NULL; } |
87 | 87 |
88 const string16& BalloonHost::GetSource() const { | 88 const string16& BalloonHost::GetSource() const { |
89 return balloon_->notification().display_source(); | 89 return balloon_->notification().display_source(); |
90 } | 90 } |
91 | 91 |
92 WebPreferences BalloonHost::GetWebkitPrefs() { | 92 WebPreferences BalloonHost::GetWebkitPrefs() { |
93 WebPreferences web_prefs = | 93 WebPreferences web_prefs = |
94 RenderViewHostDelegateHelper::GetWebkitPrefs(GetProfile(), enable_dom_ui_)
; | 94 RenderViewHostDelegateHelper::GetWebkitPrefs(GetProfile(), |
| 95 enable_dom_ui_); |
95 web_prefs.allow_scripts_to_close_windows = true; | 96 web_prefs.allow_scripts_to_close_windows = true; |
96 return web_prefs; | 97 return web_prefs; |
97 } | 98 } |
98 | 99 |
99 SiteInstance* BalloonHost::GetSiteInstance() const { | 100 SiteInstance* BalloonHost::GetSiteInstance() const { |
100 return site_instance_.get(); | 101 return site_instance_.get(); |
101 } | 102 } |
102 | 103 |
103 Profile* BalloonHost::GetProfile() const { | 104 Profile* BalloonHost::GetProfile() const { |
104 return balloon_->profile(); | 105 return balloon_->profile(); |
(...skipping 20 matching lines...) Expand all Loading... |
125 #endif | 126 #endif |
126 } | 127 } |
127 | 128 |
128 void BalloonHost::RenderViewReady(RenderViewHost* render_view_host) { | 129 void BalloonHost::RenderViewReady(RenderViewHost* render_view_host) { |
129 should_notify_on_disconnect_ = true; | 130 should_notify_on_disconnect_ = true; |
130 NotificationService::current()->Notify( | 131 NotificationService::current()->Notify( |
131 NotificationType::NOTIFY_BALLOON_CONNECTED, | 132 NotificationType::NOTIFY_BALLOON_CONNECTED, |
132 Source<BalloonHost>(this), NotificationService::NoDetails()); | 133 Source<BalloonHost>(this), NotificationService::NoDetails()); |
133 } | 134 } |
134 | 135 |
135 void BalloonHost::RenderViewGone(RenderViewHost* render_view_host) { | 136 void BalloonHost::RenderViewGone(RenderViewHost* render_view_host, |
| 137 base::TerminationStatus status, |
| 138 int error_code) { |
136 Close(render_view_host); | 139 Close(render_view_host); |
137 } | 140 } |
138 | 141 |
139 int BalloonHost::GetBrowserWindowID() const { | 142 int BalloonHost::GetBrowserWindowID() const { |
140 return extension_misc::kUnknownWindowId; | 143 return extension_misc::kUnknownWindowId; |
141 } | 144 } |
142 | 145 |
143 ViewType::Type BalloonHost::GetRenderViewType() const { | 146 ViewType::Type BalloonHost::GetRenderViewType() const { |
144 return ViewType::NOTIFICATION; | 147 return ViewType::NOTIFICATION; |
145 } | 148 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 266 |
264 void BalloonHost::NotifyDisconnect() { | 267 void BalloonHost::NotifyDisconnect() { |
265 if (!should_notify_on_disconnect_) | 268 if (!should_notify_on_disconnect_) |
266 return; | 269 return; |
267 | 270 |
268 should_notify_on_disconnect_ = false; | 271 should_notify_on_disconnect_ = false; |
269 NotificationService::current()->Notify( | 272 NotificationService::current()->Notify( |
270 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 273 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
271 Source<BalloonHost>(this), NotificationService::NoDetails()); | 274 Source<BalloonHost>(this), NotificationService::NoDetails()); |
272 } | 275 } |
OLD | NEW |