Chromium Code Reviews| 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 252 base_tab_contents->view()->GetContainerSize() : gfx::Size()); | 252 base_tab_contents->view()->GetContainerSize() : gfx::Size()); |
| 253 | 253 |
| 254 // Register for notifications about all interested prefs change. | 254 // Register for notifications about all interested prefs change. |
| 255 PrefService* prefs = profile->GetPrefs(); | 255 PrefService* prefs = profile->GetPrefs(); |
| 256 pref_change_registrar_.Init(prefs); | 256 pref_change_registrar_.Init(prefs); |
| 257 if (prefs) { | 257 if (prefs) { |
| 258 for (int i = 0; i < kPrefsToObserveLength; ++i) | 258 for (int i = 0; i < kPrefsToObserveLength; ++i) |
| 259 pref_change_registrar_.Add(kPrefsToObserve[i], this); | 259 pref_change_registrar_.Add(kPrefsToObserve[i], this); |
| 260 } | 260 } |
| 261 | 261 |
| 262 registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSING, | |
| 263 NotificationService::AllSources()); | |
| 262 registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, | 264 registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, |
| 263 NotificationService::AllSources()); | 265 NotificationService::AllSources()); |
| 264 #if defined(OS_LINUX) | 266 #if defined(OS_LINUX) |
| 265 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 267 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, |
| 266 NotificationService::AllSources()); | 268 NotificationService::AllSources()); |
| 267 #endif | 269 #endif |
| 268 | 270 |
| 269 registrar_.Add(this, NotificationType::USER_STYLE_SHEET_UPDATED, | 271 registrar_.Add(this, NotificationType::USER_STYLE_SHEET_UPDATED, |
| 270 NotificationService::AllSources()); | 272 NotificationService::AllSources()); |
| 271 | 273 |
| (...skipping 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2141 UpdateZoomLevel(); | 2143 UpdateZoomLevel(); |
| 2142 } else if (*pref_name_in == prefs::kEnableReferrers) { | 2144 } else if (*pref_name_in == prefs::kEnableReferrers) { |
| 2143 renderer_preferences_util::UpdateFromSystemSettings( | 2145 renderer_preferences_util::UpdateFromSystemSettings( |
| 2144 &renderer_preferences_, profile()); | 2146 &renderer_preferences_, profile()); |
| 2145 render_view_host()->SyncRendererPrefs(); | 2147 render_view_host()->SyncRendererPrefs(); |
| 2146 } else { | 2148 } else { |
| 2147 NOTREACHED() << "unexpected pref change notification" << *pref_name_in; | 2149 NOTREACHED() << "unexpected pref change notification" << *pref_name_in; |
| 2148 } | 2150 } |
| 2149 break; | 2151 break; |
| 2150 } | 2152 } |
| 2153 case NotificationType::RENDERER_PROCESS_CLOSING: | |
|
jam
2011/05/06 17:45:11
why do you listen to this in TabContents and then
Charlie Reis
2011/05/10 00:57:03
RenderViewHostManager wasn't a NotificationObserve
| |
| 2154 render_manager_.RendererProcessClosing( | |
| 2155 Source<RenderProcessHost>(source).ptr()); | |
| 2156 break; | |
| 2157 | |
| 2151 case NotificationType::RENDER_WIDGET_HOST_DESTROYED: | 2158 case NotificationType::RENDER_WIDGET_HOST_DESTROYED: |
| 2152 view_->RenderWidgetHostDestroyed(Source<RenderWidgetHost>(source).ptr()); | 2159 view_->RenderWidgetHostDestroyed(Source<RenderWidgetHost>(source).ptr()); |
| 2153 break; | 2160 break; |
| 2154 | 2161 |
| 2155 case NotificationType::NAV_ENTRY_COMMITTED: { | 2162 case NotificationType::NAV_ENTRY_COMMITTED: { |
| 2156 DCHECK(&controller_ == Source<NavigationController>(source).ptr()); | 2163 DCHECK(&controller_ == Source<NavigationController>(source).ptr()); |
| 2157 | 2164 |
| 2158 NavigationController::LoadCommittedDetails& committed_details = | 2165 NavigationController::LoadCommittedDetails& committed_details = |
| 2159 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2166 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2160 ExpireInfoBars(committed_details); | 2167 ExpireInfoBars(committed_details); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2240 | 2247 |
| 2241 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2248 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2242 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 2249 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 2243 rwh_view->SetSize(view()->GetContainerSize()); | 2250 rwh_view->SetSize(view()->GetContainerSize()); |
| 2244 } | 2251 } |
| 2245 | 2252 |
| 2246 void TabContents::OnOnlineStateChanged(bool online) { | 2253 void TabContents::OnOnlineStateChanged(bool online) { |
| 2247 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 2254 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
| 2248 render_view_host()->routing_id(), online)); | 2255 render_view_host()->routing_id(), online)); |
| 2249 } | 2256 } |
| OLD | NEW |