| 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/in_process_webkit/webkit_context.h" | 8 #include "chrome/browser/in_process_webkit/webkit_context.h" |
| 9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
| 10 #include "chrome/browser/notifications/balloon.h" | 10 #include "chrome/browser/notifications/balloon.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // RenderViewHostDelegate::View methods implemented to allow links to | 87 // RenderViewHostDelegate::View methods implemented to allow links to |
| 88 // open pages in new tabs. | 88 // open pages in new tabs. |
| 89 void BalloonHost::CreateNewWindow( | 89 void BalloonHost::CreateNewWindow( |
| 90 int route_id, | 90 int route_id, |
| 91 WindowContainerType window_container_type, | 91 WindowContainerType window_container_type, |
| 92 const string16& frame_name) { | 92 const string16& frame_name) { |
| 93 delegate_view_helper_.CreateNewWindow( | 93 delegate_view_helper_.CreateNewWindow( |
| 94 route_id, | 94 route_id, |
| 95 balloon_->profile(), | 95 balloon_->profile(), |
| 96 site_instance_.get(), | 96 site_instance_.get(), |
| 97 DOMUIFactory::GetDOMUIType(balloon_->notification().content_url()), | 97 DOMUIFactory::GetDOMUIType(balloon_->profile(), |
| 98 balloon_->notification().content_url()), |
| 98 this, | 99 this, |
| 99 window_container_type, | 100 window_container_type, |
| 100 frame_name); | 101 frame_name); |
| 101 } | 102 } |
| 102 | 103 |
| 103 void BalloonHost::ShowCreatedWindow(int route_id, | 104 void BalloonHost::ShowCreatedWindow(int route_id, |
| 104 WindowOpenDisposition disposition, | 105 WindowOpenDisposition disposition, |
| 105 const gfx::Rect& initial_pos, | 106 const gfx::Rect& initial_pos, |
| 106 bool user_gesture) { | 107 bool user_gesture) { |
| 107 // Don't allow pop-ups from notifications. | 108 // Don't allow pop-ups from notifications. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 void BalloonHost::NotifyDisconnect() { | 169 void BalloonHost::NotifyDisconnect() { |
| 169 if (!should_notify_on_disconnect_) | 170 if (!should_notify_on_disconnect_) |
| 170 return; | 171 return; |
| 171 | 172 |
| 172 should_notify_on_disconnect_ = false; | 173 should_notify_on_disconnect_ = false; |
| 173 NotificationService::current()->Notify( | 174 NotificationService::current()->Notify( |
| 174 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 175 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
| 175 Source<BalloonHost>(this), NotificationService::NoDetails()); | 176 Source<BalloonHost>(this), NotificationService::NoDetails()); |
| 176 } | 177 } |
| OLD | NEW |