| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "chrome/browser/notifications/balloon.h" |
| 6 #include "chrome/browser/notifications/balloon_host.h" | 6 #include "chrome/browser/notifications/balloon_host.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.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 WindowOpenDisposition disposition, | 78 WindowOpenDisposition disposition, |
| 79 const gfx::Rect& initial_pos, | 79 const gfx::Rect& initial_pos, |
| 80 bool user_gesture) { | 80 bool user_gesture) { |
| 81 Browser* browser = BrowserList::GetLastActiveWithProfile( | 81 Browser* browser = BrowserList::GetLastActiveWithProfile( |
| 82 Profile::FromBrowserContext(new_contents->GetBrowserContext())); | 82 Profile::FromBrowserContext(new_contents->GetBrowserContext())); |
| 83 if (!browser) | 83 if (!browser) |
| 84 return; | 84 return; |
| 85 browser->AddWebContents(new_contents, disposition, initial_pos, user_gesture); | 85 browser->AddWebContents(new_contents, disposition, initial_pos, user_gesture); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void BalloonHost::RenderViewCreated(RenderViewHost* render_view_host) { | 88 void BalloonHost::RenderViewCreated(content::RenderViewHost* render_view_host) { |
| 89 render_view_host->DisableScrollbarsForThreshold( | 89 render_view_host->DisableScrollbarsForThreshold( |
| 90 balloon_->min_scrollbar_size()); | 90 balloon_->min_scrollbar_size()); |
| 91 render_view_host->WasResized(); | 91 render_view_host->WasResized(); |
| 92 render_view_host->EnablePreferredSizeMode(); | 92 render_view_host->EnablePreferredSizeMode(); |
| 93 | 93 |
| 94 if (enable_web_ui_) | 94 if (enable_web_ui_) |
| 95 render_view_host->AllowBindings(content::BINDINGS_POLICY_WEB_UI); | 95 render_view_host->AllowBindings(content::BINDINGS_POLICY_WEB_UI); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void BalloonHost::RenderViewReady() { | 98 void BalloonHost::RenderViewReady() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 should_notify_on_disconnect_ = false; | 156 should_notify_on_disconnect_ = false; |
| 157 content::NotificationService::current()->Notify( | 157 content::NotificationService::current()->Notify( |
| 158 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 158 chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
| 159 content::Source<BalloonHost>(this), | 159 content::Source<BalloonHost>(this), |
| 160 content::NotificationService::NoDetails()); | 160 content::NotificationService::NoDetails()); |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool BalloonHost::IsRenderViewReady() const { | 163 bool BalloonHost::IsRenderViewReady() const { |
| 164 return should_notify_on_disconnect_; | 164 return should_notify_on_disconnect_; |
| 165 } | 165 } |
| OLD | NEW |