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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 86 } |
87 | 87 |
88 void BalloonHost::RenderViewReady() { | 88 void BalloonHost::RenderViewReady() { |
89 should_notify_on_disconnect_ = true; | 89 should_notify_on_disconnect_ = true; |
90 content::NotificationService::current()->Notify( | 90 content::NotificationService::current()->Notify( |
91 chrome::NOTIFICATION_NOTIFY_BALLOON_CONNECTED, | 91 chrome::NOTIFICATION_NOTIFY_BALLOON_CONNECTED, |
92 content::Source<BalloonHost>(this), | 92 content::Source<BalloonHost>(this), |
93 content::NotificationService::NoDetails()); | 93 content::NotificationService::NoDetails()); |
94 } | 94 } |
95 | 95 |
96 void BalloonHost::RenderViewGone() { | 96 void BalloonHost::RenderViewGone(base::TerminationStatus status) { |
97 CloseContents(tab_contents_.get()); | 97 CloseContents(tab_contents_.get()); |
98 } | 98 } |
99 | 99 |
100 bool BalloonHost::OnMessageReceived(const IPC::Message& message) { | 100 bool BalloonHost::OnMessageReceived(const IPC::Message& message) { |
101 bool handled = true; | 101 bool handled = true; |
102 IPC_BEGIN_MESSAGE_MAP(BalloonHost, message) | 102 IPC_BEGIN_MESSAGE_MAP(BalloonHost, message) |
103 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) | 103 IPC_MESSAGE_HANDLER(ExtensionHostMsg_Request, OnRequest) |
104 IPC_MESSAGE_UNHANDLED(handled = false) | 104 IPC_MESSAGE_UNHANDLED(handled = false) |
105 IPC_END_MESSAGE_MAP() | 105 IPC_END_MESSAGE_MAP() |
106 return handled; | 106 return handled; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 should_notify_on_disconnect_ = false; | 146 should_notify_on_disconnect_ = false; |
147 content::NotificationService::current()->Notify( | 147 content::NotificationService::current()->Notify( |
148 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 148 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
149 content::Source<BalloonHost>(this), | 149 content::Source<BalloonHost>(this), |
150 content::NotificationService::NoDetails()); | 150 content::NotificationService::NoDetails()); |
151 } | 151 } |
152 | 152 |
153 bool BalloonHost::IsRenderViewReady() const { | 153 bool BalloonHost::IsRenderViewReady() const { |
154 return should_notify_on_disconnect_; | 154 return should_notify_on_disconnect_; |
155 } | 155 } |
OLD | NEW |