| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 temporary_zoom_settings_(false), | 192 temporary_zoom_settings_(false), |
| 193 content_restrictions_(0) { | 193 content_restrictions_(0) { |
| 194 | 194 |
| 195 render_manager_.Init(profile, site_instance, routing_id); | 195 render_manager_.Init(profile, site_instance, routing_id); |
| 196 | 196 |
| 197 // We have the initial size of the view be based on the size of the passed in | 197 // We have the initial size of the view be based on the size of the passed in |
| 198 // tab contents (normally a tab from the same window). | 198 // tab contents (normally a tab from the same window). |
| 199 view_->CreateView(base_tab_contents ? | 199 view_->CreateView(base_tab_contents ? |
| 200 base_tab_contents->view()->GetContainerSize() : gfx::Size()); | 200 base_tab_contents->view()->GetContainerSize() : gfx::Size()); |
| 201 | 201 |
| 202 registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, | 202 registrar_.Add(this, content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, |
| 203 NotificationService::AllSources()); | 203 NotificationService::AllSources()); |
| 204 | 204 |
| 205 // Can only add observers after render_manager_.Init() is called, since that's | 205 // Can only add observers after render_manager_.Init() is called, since that's |
| 206 // what sets up the render_view_host which TabContentObserver's constructor | 206 // what sets up the render_view_host which TabContentObserver's constructor |
| 207 // uses to get the routing_id. | 207 // uses to get the routing_id. |
| 208 AddObservers(); | 208 AddObservers(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 TabContents::~TabContents() { | 211 TabContents::~TabContents() { |
| 212 is_being_destroyed_ = true; | 212 is_being_destroyed_ = true; |
| 213 | 213 |
| 214 // We don't want any notifications while we're running our destructor. | 214 // We don't want any notifications while we're running our destructor. |
| 215 registrar_.RemoveAll(); | 215 registrar_.RemoveAll(); |
| 216 | 216 |
| 217 // Clear out any JavaScript state. | 217 // Clear out any JavaScript state. |
| 218 if (delegate_) | 218 if (delegate_) |
| 219 delegate_->GetJavaScriptDialogCreator()->ResetJavaScriptState(this); | 219 delegate_->GetJavaScriptDialogCreator()->ResetJavaScriptState(this); |
| 220 | 220 |
| 221 NotifyDisconnected(); | 221 NotifyDisconnected(); |
| 222 | 222 |
| 223 // First cleanly close all child windows. | 223 // First cleanly close all child windows. |
| 224 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked | 224 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked |
| 225 // some of these to close. CloseWindows is async, so it might get called | 225 // some of these to close. CloseWindows is async, so it might get called |
| 226 // twice before it runs. | 226 // twice before it runs. |
| 227 CloseConstrainedWindows(); | 227 CloseConstrainedWindows(); |
| 228 | 228 |
| 229 // Notify any observer that have a reference on this tab contents. | 229 // Notify any observer that have a reference on this tab contents. |
| 230 NotificationService::current()->Notify( | 230 NotificationService::current()->Notify( |
| 231 NotificationType::TAB_CONTENTS_DESTROYED, | 231 content::NOTIFICATION_TAB_CONTENTS_DESTROYED, |
| 232 Source<TabContents>(this), | 232 Source<TabContents>(this), |
| 233 NotificationService::NoDetails()); | 233 NotificationService::NoDetails()); |
| 234 | 234 |
| 235 // TODO(brettw) this should be moved to the view. | 235 // TODO(brettw) this should be moved to the view. |
| 236 #if defined(OS_WIN) | 236 #if defined(OS_WIN) |
| 237 // If we still have a window handle, destroy it. GetNativeView can return | 237 // If we still have a window handle, destroy it. GetNativeView can return |
| 238 // NULL if this contents was part of a window that closed. | 238 // NULL if this contents was part of a window that closed. |
| 239 if (GetNativeView()) { | 239 if (GetNativeView()) { |
| 240 RenderViewHost* host = render_view_host(); | 240 RenderViewHost* host = render_view_host(); |
| 241 if (host && host->view()) | 241 if (host && host->view()) |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 // a tab in then background, then closes the tab before selecting it. This | 447 // a tab in then background, then closes the tab before selecting it. This |
| 448 // is because closing the tab calls TabContents::Destroy(), which removes | 448 // is because closing the tab calls TabContents::Destroy(), which removes |
| 449 // the |render_view_host()|; then when we actually destroy the window, | 449 // the |render_view_host()|; then when we actually destroy the window, |
| 450 // OnWindowPosChanged() notices and calls HideContents() (which calls us). | 450 // OnWindowPosChanged() notices and calls HideContents() (which calls us). |
| 451 RenderWidgetHostView* rwhv = GetRenderWidgetHostView(); | 451 RenderWidgetHostView* rwhv = GetRenderWidgetHostView(); |
| 452 if (rwhv) | 452 if (rwhv) |
| 453 rwhv->WasHidden(); | 453 rwhv->WasHidden(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 NotificationService::current()->Notify( | 456 NotificationService::current()->Notify( |
| 457 NotificationType::TAB_CONTENTS_HIDDEN, | 457 content::NOTIFICATION_TAB_CONTENTS_HIDDEN, |
| 458 Source<TabContents>(this), | 458 Source<TabContents>(this), |
| 459 NotificationService::NoDetails()); | 459 NotificationService::NoDetails()); |
| 460 } | 460 } |
| 461 | 461 |
| 462 void TabContents::Activate() { | 462 void TabContents::Activate() { |
| 463 if (delegate_) | 463 if (delegate_) |
| 464 delegate_->ActivateContents(this); | 464 delegate_->ActivateContents(this); |
| 465 } | 465 } |
| 466 | 466 |
| 467 void TabContents::Deactivate() { | 467 void TabContents::Deactivate() { |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 render_manager_.RendererAbortedProvisionalLoad(render_view_host()); | 882 render_manager_.RendererAbortedProvisionalLoad(render_view_host()); |
| 883 } | 883 } |
| 884 | 884 |
| 885 // Send out a notification that we failed a provisional load with an error. | 885 // Send out a notification that we failed a provisional load with an error. |
| 886 ProvisionalLoadDetails details( | 886 ProvisionalLoadDetails details( |
| 887 is_main_frame, controller_.IsURLInPageNavigation(validated_url), | 887 is_main_frame, controller_.IsURLInPageNavigation(validated_url), |
| 888 validated_url, std::string(), false, frame_id); | 888 validated_url, std::string(), false, frame_id); |
| 889 details.set_error_code(error_code); | 889 details.set_error_code(error_code); |
| 890 | 890 |
| 891 NotificationService::current()->Notify( | 891 NotificationService::current()->Notify( |
| 892 NotificationType::FAIL_PROVISIONAL_LOAD_WITH_ERROR, | 892 content::NOTIFICATION_FAIL_PROVISIONAL_LOAD_WITH_ERROR, |
| 893 Source<NavigationController>(&controller_), | 893 Source<NavigationController>(&controller_), |
| 894 Details<ProvisionalLoadDetails>(&details)); | 894 Details<ProvisionalLoadDetails>(&details)); |
| 895 | 895 |
| 896 FOR_EACH_OBSERVER(TabContentsObserver, observers_, | 896 FOR_EACH_OBSERVER(TabContentsObserver, observers_, |
| 897 DidFailProvisionalLoad(frame_id, is_main_frame, | 897 DidFailProvisionalLoad(frame_id, is_main_frame, |
| 898 validated_url, error_code)); | 898 validated_url, error_code)); |
| 899 } | 899 } |
| 900 | 900 |
| 901 void TabContents::OnDidLoadResourceFromMemoryCache( | 901 void TabContents::OnDidLoadResourceFromMemoryCache( |
| 902 const GURL& url, | 902 const GURL& url, |
| 903 const std::string& security_info) { | 903 const std::string& security_info) { |
| 904 base::StatsCounter cache("WebKit.CacheHit"); | 904 base::StatsCounter cache("WebKit.CacheHit"); |
| 905 cache.Increment(); | 905 cache.Increment(); |
| 906 | 906 |
| 907 // Send out a notification that we loaded a resource from our memory cache. | 907 // Send out a notification that we loaded a resource from our memory cache. |
| 908 int cert_id = 0, cert_status = 0, security_bits = -1, connection_status = 0; | 908 int cert_id = 0, cert_status = 0, security_bits = -1, connection_status = 0; |
| 909 SSLManager::DeserializeSecurityInfo(security_info, | 909 SSLManager::DeserializeSecurityInfo(security_info, |
| 910 &cert_id, &cert_status, | 910 &cert_id, &cert_status, |
| 911 &security_bits, | 911 &security_bits, |
| 912 &connection_status); | 912 &connection_status); |
| 913 LoadFromMemoryCacheDetails details(url, GetRenderProcessHost()->id(), | 913 LoadFromMemoryCacheDetails details(url, GetRenderProcessHost()->id(), |
| 914 cert_id, cert_status); | 914 cert_id, cert_status); |
| 915 | 915 |
| 916 NotificationService::current()->Notify( | 916 NotificationService::current()->Notify( |
| 917 NotificationType::LOAD_FROM_MEMORY_CACHE, | 917 content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, |
| 918 Source<NavigationController>(&controller_), | 918 Source<NavigationController>(&controller_), |
| 919 Details<LoadFromMemoryCacheDetails>(&details)); | 919 Details<LoadFromMemoryCacheDetails>(&details)); |
| 920 } | 920 } |
| 921 | 921 |
| 922 void TabContents::OnDidDisplayInsecureContent() { | 922 void TabContents::OnDidDisplayInsecureContent() { |
| 923 UserMetrics::RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); | 923 UserMetrics::RecordAction(UserMetricsAction("SSL.DisplayedInsecureContent")); |
| 924 displayed_insecure_content_ = true; | 924 displayed_insecure_content_ = true; |
| 925 SSLManager::NotifySSLInternalStateChanged(); | 925 SSLManager::NotifySSLInternalStateChanged(); |
| 926 } | 926 } |
| 927 | 927 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 void TabContents::OnUpdateZoomLimits(int minimum_percent, | 967 void TabContents::OnUpdateZoomLimits(int minimum_percent, |
| 968 int maximum_percent, | 968 int maximum_percent, |
| 969 bool remember) { | 969 bool remember) { |
| 970 minimum_zoom_percent_ = minimum_percent; | 970 minimum_zoom_percent_ = minimum_percent; |
| 971 maximum_zoom_percent_ = maximum_percent; | 971 maximum_zoom_percent_ = maximum_percent; |
| 972 temporary_zoom_settings_ = !remember; | 972 temporary_zoom_settings_ = !remember; |
| 973 } | 973 } |
| 974 | 974 |
| 975 void TabContents::OnFocusedNodeChanged(bool is_editable_node) { | 975 void TabContents::OnFocusedNodeChanged(bool is_editable_node) { |
| 976 NotificationService::current()->Notify( | 976 NotificationService::current()->Notify( |
| 977 NotificationType::FOCUS_CHANGED_IN_PAGE, | 977 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 978 Source<TabContents>(this), | 978 Source<TabContents>(this), |
| 979 Details<const bool>(&is_editable_node)); | 979 Details<const bool>(&is_editable_node)); |
| 980 } | 980 } |
| 981 | 981 |
| 982 // Notifies the RenderWidgetHost instance about the fact that the page is | 982 // Notifies the RenderWidgetHost instance about the fact that the page is |
| 983 // loading, or done loading and calls the base implementation. | 983 // loading, or done loading and calls the base implementation. |
| 984 void TabContents::SetIsLoading(bool is_loading, | 984 void TabContents::SetIsLoading(bool is_loading, |
| 985 LoadNotificationDetails* details) { | 985 LoadNotificationDetails* details) { |
| 986 if (is_loading == is_loading_) | 986 if (is_loading == is_loading_) |
| 987 return; | 987 return; |
| 988 | 988 |
| 989 if (!is_loading) { | 989 if (!is_loading) { |
| 990 load_state_ = net::LOAD_STATE_IDLE; | 990 load_state_ = net::LOAD_STATE_IDLE; |
| 991 load_state_host_.clear(); | 991 load_state_host_.clear(); |
| 992 upload_size_ = 0; | 992 upload_size_ = 0; |
| 993 upload_position_ = 0; | 993 upload_position_ = 0; |
| 994 } | 994 } |
| 995 | 995 |
| 996 render_manager_.SetIsLoading(is_loading); | 996 render_manager_.SetIsLoading(is_loading); |
| 997 | 997 |
| 998 is_loading_ = is_loading; | 998 is_loading_ = is_loading; |
| 999 waiting_for_response_ = is_loading; | 999 waiting_for_response_ = is_loading; |
| 1000 | 1000 |
| 1001 if (delegate_) | 1001 if (delegate_) |
| 1002 delegate_->LoadingStateChanged(this); | 1002 delegate_->LoadingStateChanged(this); |
| 1003 NotifyNavigationStateChanged(INVALIDATE_LOAD); | 1003 NotifyNavigationStateChanged(INVALIDATE_LOAD); |
| 1004 | 1004 |
| 1005 NotificationType type = is_loading ? NotificationType::LOAD_START : | 1005 int type = is_loading ? content::NOTIFICATION_LOAD_START : |
| 1006 NotificationType::LOAD_STOP; | 1006 content::NOTIFICATION_LOAD_STOP; |
| 1007 NotificationDetails det = NotificationService::NoDetails(); | 1007 NotificationDetails det = NotificationService::NoDetails(); |
| 1008 if (details) | 1008 if (details) |
| 1009 det = Details<LoadNotificationDetails>(details); | 1009 det = Details<LoadNotificationDetails>(details); |
| 1010 NotificationService::current()->Notify(type, | 1010 NotificationService::current()->Notify(type, |
| 1011 Source<NavigationController>(&controller_), | 1011 Source<NavigationController>(&controller_), |
| 1012 det); | 1012 det); |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 WebUI* TabContents::GetWebUIForCurrentState() { | 1015 WebUI* TabContents::GetWebUIForCurrentState() { |
| 1016 // When there is a pending navigation entry, we want to use the pending WebUI | 1016 // When there is a pending navigation entry, we want to use the pending WebUI |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 | 1188 |
| 1189 page_title_when_no_navigation_entry_ = final_title; | 1189 page_title_when_no_navigation_entry_ = final_title; |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 // Lastly, set the title for the view. | 1192 // Lastly, set the title for the view. |
| 1193 view_->SetPageTitle(UTF16ToWideHack(final_title)); | 1193 view_->SetPageTitle(UTF16ToWideHack(final_title)); |
| 1194 | 1194 |
| 1195 TitleUpdatedDetails details(entry, explicit_set); | 1195 TitleUpdatedDetails details(entry, explicit_set); |
| 1196 | 1196 |
| 1197 NotificationService::current()->Notify( | 1197 NotificationService::current()->Notify( |
| 1198 NotificationType::TAB_CONTENTS_TITLE_UPDATED, | 1198 content::NOTIFICATION_TAB_CONTENTS_TITLE_UPDATED, |
| 1199 Source<TabContents>(this), | 1199 Source<TabContents>(this), |
| 1200 Details<TitleUpdatedDetails>(&details)); | 1200 Details<TitleUpdatedDetails>(&details)); |
| 1201 | 1201 |
| 1202 return true; | 1202 return true; |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 void TabContents::NotifySwapped() { | 1205 void TabContents::NotifySwapped() { |
| 1206 // After sending out a swap notification, we need to send a disconnect | 1206 // After sending out a swap notification, we need to send a disconnect |
| 1207 // notification so that clients that pick up a pointer to |this| can NULL the | 1207 // notification so that clients that pick up a pointer to |this| can NULL the |
| 1208 // pointer. See Bug 1230284. | 1208 // pointer. See Bug 1230284. |
| 1209 notify_disconnection_ = true; | 1209 notify_disconnection_ = true; |
| 1210 NotificationService::current()->Notify( | 1210 NotificationService::current()->Notify( |
| 1211 NotificationType::TAB_CONTENTS_SWAPPED, | 1211 content::NOTIFICATION_TAB_CONTENTS_SWAPPED, |
| 1212 Source<TabContents>(this), | 1212 Source<TabContents>(this), |
| 1213 NotificationService::NoDetails()); | 1213 NotificationService::NoDetails()); |
| 1214 } | 1214 } |
| 1215 | 1215 |
| 1216 void TabContents::NotifyConnected() { | 1216 void TabContents::NotifyConnected() { |
| 1217 notify_disconnection_ = true; | 1217 notify_disconnection_ = true; |
| 1218 NotificationService::current()->Notify( | 1218 NotificationService::current()->Notify( |
| 1219 NotificationType::TAB_CONTENTS_CONNECTED, | 1219 content::NOTIFICATION_TAB_CONTENTS_CONNECTED, |
| 1220 Source<TabContents>(this), | 1220 Source<TabContents>(this), |
| 1221 NotificationService::NoDetails()); | 1221 NotificationService::NoDetails()); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 void TabContents::NotifyDisconnected() { | 1224 void TabContents::NotifyDisconnected() { |
| 1225 if (!notify_disconnection_) | 1225 if (!notify_disconnection_) |
| 1226 return; | 1226 return; |
| 1227 | 1227 |
| 1228 notify_disconnection_ = false; | 1228 notify_disconnection_ = false; |
| 1229 NotificationService::current()->Notify( | 1229 NotificationService::current()->Notify( |
| 1230 NotificationType::TAB_CONTENTS_DISCONNECTED, | 1230 content::NOTIFICATION_TAB_CONTENTS_DISCONNECTED, |
| 1231 Source<TabContents>(this), | 1231 Source<TabContents>(this), |
| 1232 NotificationService::NoDetails()); | 1232 NotificationService::NoDetails()); |
| 1233 } | 1233 } |
| 1234 | 1234 |
| 1235 RenderViewHostDelegate::View* TabContents::GetViewDelegate() { | 1235 RenderViewHostDelegate::View* TabContents::GetViewDelegate() { |
| 1236 return view_.get(); | 1236 return view_.get(); |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 RenderViewHostDelegate::RendererManagement* | 1239 RenderViewHostDelegate::RendererManagement* |
| 1240 TabContents::GetRendererManagementDelegate() { | 1240 TabContents::GetRendererManagementDelegate() { |
| 1241 return &render_manager_; | 1241 return &render_manager_; |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 RendererPreferences TabContents::GetRendererPrefs(Profile* profile) const { | 1244 RendererPreferences TabContents::GetRendererPrefs(Profile* profile) const { |
| 1245 return renderer_preferences_; | 1245 return renderer_preferences_; |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 TabContents* TabContents::GetAsTabContents() { | 1248 TabContents* TabContents::GetAsTabContents() { |
| 1249 return this; | 1249 return this; |
| 1250 } | 1250 } |
| 1251 | 1251 |
| 1252 ViewType::Type TabContents::GetRenderViewType() const { | 1252 ViewType::Type TabContents::GetRenderViewType() const { |
| 1253 return ViewType::TAB_CONTENTS; | 1253 return ViewType::TAB_CONTENTS; |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { | 1256 void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { |
| 1257 NotificationService::current()->Notify( | 1257 NotificationService::current()->Notify( |
| 1258 NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, | 1258 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, |
| 1259 Source<TabContents>(this), | 1259 Source<TabContents>(this), |
| 1260 Details<RenderViewHost>(render_view_host)); | 1260 Details<RenderViewHost>(render_view_host)); |
| 1261 NavigationEntry* entry = controller_.GetActiveEntry(); | 1261 NavigationEntry* entry = controller_.GetActiveEntry(); |
| 1262 if (!entry) | 1262 if (!entry) |
| 1263 return; | 1263 return; |
| 1264 | 1264 |
| 1265 // When we're creating views, we're still doing initial setup, so we always | 1265 // When we're creating views, we're still doing initial setup, so we always |
| 1266 // use the pending Web UI rather than any possibly existing committed one. | 1266 // use the pending Web UI rather than any possibly existing committed one. |
| 1267 if (render_manager_.pending_web_ui()) | 1267 if (render_manager_.pending_web_ui()) |
| 1268 render_manager_.pending_web_ui()->RenderViewCreated(render_view_host); | 1268 render_manager_.pending_web_ui()->RenderViewCreated(render_view_host); |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1520 | 1520 |
| 1521 void TabContents::DidChangeLoadProgress(double progress) { | 1521 void TabContents::DidChangeLoadProgress(double progress) { |
| 1522 if (delegate()) | 1522 if (delegate()) |
| 1523 delegate()->LoadProgressChanged(progress); | 1523 delegate()->LoadProgressChanged(progress); |
| 1524 } | 1524 } |
| 1525 | 1525 |
| 1526 void TabContents::DocumentOnLoadCompletedInMainFrame( | 1526 void TabContents::DocumentOnLoadCompletedInMainFrame( |
| 1527 RenderViewHost* render_view_host, | 1527 RenderViewHost* render_view_host, |
| 1528 int32 page_id) { | 1528 int32 page_id) { |
| 1529 NotificationService::current()->Notify( | 1529 NotificationService::current()->Notify( |
| 1530 NotificationType::LOAD_COMPLETED_MAIN_FRAME, | 1530 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| 1531 Source<TabContents>(this), | 1531 Source<TabContents>(this), |
| 1532 Details<int>(&page_id)); | 1532 Details<int>(&page_id)); |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 void TabContents::RequestOpenURL(const GURL& url, const GURL& referrer, | 1535 void TabContents::RequestOpenURL(const GURL& url, const GURL& referrer, |
| 1536 WindowOpenDisposition disposition) { | 1536 WindowOpenDisposition disposition) { |
| 1537 if (render_manager_.web_ui()) { | 1537 if (render_manager_.web_ui()) { |
| 1538 // When we're a Web UI, it will provide a page transition type for us (this | 1538 // When we're a Web UI, it will provide a page transition type for us (this |
| 1539 // is so the new tab page can specify AUTO_BOOKMARK for automatically | 1539 // is so the new tab page can specify AUTO_BOOKMARK for automatically |
| 1540 // generated suggestions). | 1540 // generated suggestions). |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 // linux. See crbug.com/83941. | 1783 // linux. See crbug.com/83941. |
| 1784 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) | 1784 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) |
| 1785 render_widget_host->WasResized(); | 1785 render_widget_host->WasResized(); |
| 1786 #endif | 1786 #endif |
| 1787 | 1787 |
| 1788 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(), | 1788 UpdateMaxPageIDIfNecessary(render_view_host->site_instance(), |
| 1789 render_view_host); | 1789 render_view_host); |
| 1790 return true; | 1790 return true; |
| 1791 } | 1791 } |
| 1792 | 1792 |
| 1793 void TabContents::Observe(NotificationType type, | 1793 void TabContents::Observe(int type, |
| 1794 const NotificationSource& source, | 1794 const NotificationSource& source, |
| 1795 const NotificationDetails& details) { | 1795 const NotificationDetails& details) { |
| 1796 switch (type.value) { | 1796 switch (type) { |
| 1797 case NotificationType::RENDER_WIDGET_HOST_DESTROYED: | 1797 case content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED: |
| 1798 view_->RenderWidgetHostDestroyed(Source<RenderWidgetHost>(source).ptr()); | 1798 view_->RenderWidgetHostDestroyed(Source<RenderWidgetHost>(source).ptr()); |
| 1799 break; | 1799 break; |
| 1800 default: | 1800 default: |
| 1801 NOTREACHED(); | 1801 NOTREACHED(); |
| 1802 } | 1802 } |
| 1803 } | 1803 } |
| 1804 | 1804 |
| 1805 // Overridden from JavaScriptDialogDelegate | 1805 // Overridden from JavaScriptDialogDelegate |
| 1806 | 1806 |
| 1807 void TabContents::OnDialogClosed(IPC::Message* reply_msg, | 1807 void TabContents::OnDialogClosed(IPC::Message* reply_msg, |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 | 1839 |
| 1840 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1840 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 1841 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1841 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
| 1842 rwh_view->SetSize(view()->GetContainerSize()); | 1842 rwh_view->SetSize(view()->GetContainerSize()); |
| 1843 } | 1843 } |
| 1844 | 1844 |
| 1845 void TabContents::OnOnlineStateChanged(bool online) { | 1845 void TabContents::OnOnlineStateChanged(bool online) { |
| 1846 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 1846 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
| 1847 render_view_host()->routing_id(), online)); | 1847 render_view_host()->routing_id(), online)); |
| 1848 } | 1848 } |
| OLD | NEW |