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 | 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/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/notifications/balloon.h" | 10 #include "chrome/browser/notifications/balloon.h" |
11 #include "chrome/browser/notifications/notification.h" | 11 #include "chrome/browser/notifications/notification.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 13 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
14 #include "chrome/browser/renderer_preferences_util.h" | 14 #include "chrome/browser/renderer_preferences_util.h" |
| 15 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" |
15 #include "chrome/common/bindings_policy.h" | 16 #include "chrome/common/bindings_policy.h" |
16 #include "chrome/common/render_messages.h" | 17 #include "chrome/common/render_messages.h" |
17 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
18 #include "content/browser/renderer_host/render_view_host.h" | 19 #include "content/browser/renderer_host/render_view_host.h" |
19 #include "content/browser/site_instance.h" | 20 #include "content/browser/site_instance.h" |
20 #include "content/common/notification_service.h" | 21 #include "content/common/notification_service.h" |
21 #include "content/common/notification_source.h" | 22 #include "content/common/notification_source.h" |
22 #include "content/common/notification_type.h" | 23 #include "content/common/notification_type.h" |
23 #include "content/common/renderer_preferences.h" | 24 #include "content/common/renderer_preferences.h" |
24 #include "content/common/view_messages.h" | 25 #include "content/common/view_messages.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 141 |
141 // RenderViewHostDelegate::View methods implemented to allow links to | 142 // RenderViewHostDelegate::View methods implemented to allow links to |
142 // open pages in new tabs. | 143 // open pages in new tabs. |
143 void BalloonHost::CreateNewWindow( | 144 void BalloonHost::CreateNewWindow( |
144 int route_id, | 145 int route_id, |
145 const ViewHostMsg_CreateWindow_Params& params) { | 146 const ViewHostMsg_CreateWindow_Params& params) { |
146 delegate_view_helper_.CreateNewWindow( | 147 delegate_view_helper_.CreateNewWindow( |
147 route_id, | 148 route_id, |
148 balloon_->profile(), | 149 balloon_->profile(), |
149 site_instance_.get(), | 150 site_instance_.get(), |
150 WebUIFactory::GetWebUIType(balloon_->profile(), | 151 ChromeWebUIFactory::GetInstance()->GetWebUIType(balloon_->profile(), |
151 balloon_->notification().content_url()), | 152 balloon_->notification().content_url()), |
152 this, | 153 this, |
153 params.window_container_type, | 154 params.window_container_type, |
154 params.frame_name); | 155 params.frame_name); |
155 } | 156 } |
156 | 157 |
157 void BalloonHost::ShowCreatedWindow(int route_id, | 158 void BalloonHost::ShowCreatedWindow(int route_id, |
158 WindowOpenDisposition disposition, | 159 WindowOpenDisposition disposition, |
159 const gfx::Rect& initial_pos, | 160 const gfx::Rect& initial_pos, |
160 bool user_gesture) { | 161 bool user_gesture) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 261 |
261 void BalloonHost::NotifyDisconnect() { | 262 void BalloonHost::NotifyDisconnect() { |
262 if (!should_notify_on_disconnect_) | 263 if (!should_notify_on_disconnect_) |
263 return; | 264 return; |
264 | 265 |
265 should_notify_on_disconnect_ = false; | 266 should_notify_on_disconnect_ = false; |
266 NotificationService::current()->Notify( | 267 NotificationService::current()->Notify( |
267 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 268 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
268 Source<BalloonHost>(this), NotificationService::NoDetails()); | 269 Source<BalloonHost>(this), NotificationService::NoDetails()); |
269 } | 270 } |
OLD | NEW |