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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 void BalloonHost::Close(RenderViewHost* render_view_host) { | 111 void BalloonHost::Close(RenderViewHost* render_view_host) { |
112 balloon_->CloseByScript(); | 112 balloon_->CloseByScript(); |
113 NotifyDisconnect(); | 113 NotifyDisconnect(); |
114 } | 114 } |
115 | 115 |
116 void BalloonHost::RenderViewCreated(RenderViewHost* render_view_host) { | 116 void BalloonHost::RenderViewCreated(RenderViewHost* render_view_host) { |
117 render_view_host->Send(new ViewMsg_DisableScrollbarsForSmallWindows( | 117 render_view_host->Send(new ViewMsg_DisableScrollbarsForSmallWindows( |
118 render_view_host->routing_id(), balloon_->min_scrollbar_size())); | 118 render_view_host->routing_id(), balloon_->min_scrollbar_size())); |
119 render_view_host->WasResized(); | 119 render_view_host->WasResized(); |
120 #if !defined(OS_MACOSX) | 120 #if !defined(OS_MACOSX) |
| 121 // TODO(levin): Make all of the code that went in originally with this change |
| 122 // to be cross-platform. See http://crbug.com/64720 |
121 render_view_host->EnablePreferredSizeChangedMode( | 123 render_view_host->EnablePreferredSizeChangedMode( |
122 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); | 124 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); |
123 #endif | 125 #endif |
124 } | 126 } |
125 | 127 |
126 void BalloonHost::RenderViewReady(RenderViewHost* render_view_host) { | 128 void BalloonHost::RenderViewReady(RenderViewHost* render_view_host) { |
127 should_notify_on_disconnect_ = true; | 129 should_notify_on_disconnect_ = true; |
128 NotificationService::current()->Notify( | 130 NotificationService::current()->Notify( |
129 NotificationType::NOTIFY_BALLOON_CONNECTED, | 131 NotificationType::NOTIFY_BALLOON_CONNECTED, |
130 Source<BalloonHost>(this), NotificationService::NoDetails()); | 132 Source<BalloonHost>(this), NotificationService::NoDetails()); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 263 |
262 void BalloonHost::NotifyDisconnect() { | 264 void BalloonHost::NotifyDisconnect() { |
263 if (!should_notify_on_disconnect_) | 265 if (!should_notify_on_disconnect_) |
264 return; | 266 return; |
265 | 267 |
266 should_notify_on_disconnect_ = false; | 268 should_notify_on_disconnect_ = false; |
267 NotificationService::current()->Notify( | 269 NotificationService::current()->Notify( |
268 NotificationType::NOTIFY_BALLOON_DISCONNECTED, | 270 NotificationType::NOTIFY_BALLOON_DISCONNECTED, |
269 Source<BalloonHost>(this), NotificationService::NoDetails()); | 271 Source<BalloonHost>(this), NotificationService::NoDetails()); |
270 } | 272 } |
OLD | NEW |