| 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 "content/browser/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 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" |
| 11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "base/string_number_conversions.h" | 13 #include "base/string_number_conversions.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "content/browser/browser_plugin/browser_plugin_web_contents_observer.h" |
| 17 #include "content/browser/child_process_security_policy_impl.h" | 18 #include "content/browser/child_process_security_policy_impl.h" |
| 18 #include "content/browser/debugger/devtools_manager_impl.h" | 19 #include "content/browser/debugger/devtools_manager_impl.h" |
| 19 #include "content/browser/download/download_stats.h" | 20 #include "content/browser/download/download_stats.h" |
| 20 #include "content/browser/download/mhtml_generation_manager.h" | 21 #include "content/browser/download/mhtml_generation_manager.h" |
| 21 #include "content/browser/download/save_package.h" | 22 #include "content/browser/download/save_package.h" |
| 22 #include "content/browser/gpu/gpu_data_manager_impl.h" | 23 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 23 #include "content/browser/gpu/gpu_process_host.h" | 24 #include "content/browser/gpu/gpu_process_host.h" |
| 24 #include "content/browser/host_zoom_map_impl.h" | 25 #include "content/browser/host_zoom_map_impl.h" |
| 25 #include "content/browser/intents/web_intents_dispatcher_impl.h" | 26 #include "content/browser/intents/web_intents_dispatcher_impl.h" |
| 26 #include "content/browser/load_from_memory_cache_details.h" | 27 #include "content/browser/load_from_memory_cache_details.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 301 |
| 301 // We have the initial size of the view be based on the size of the passed in | 302 // We have the initial size of the view be based on the size of the passed in |
| 302 // tab contents (normally a tab from the same window). | 303 // tab contents (normally a tab from the same window). |
| 303 view_->CreateView(base_tab_contents ? | 304 view_->CreateView(base_tab_contents ? |
| 304 base_tab_contents->GetView()->GetContainerSize() : gfx::Size()); | 305 base_tab_contents->GetView()->GetContainerSize() : gfx::Size()); |
| 305 | 306 |
| 306 #if defined(ENABLE_JAVA_BRIDGE) | 307 #if defined(ENABLE_JAVA_BRIDGE) |
| 307 java_bridge_dispatcher_host_manager_.reset( | 308 java_bridge_dispatcher_host_manager_.reset( |
| 308 new JavaBridgeDispatcherHostManager(this)); | 309 new JavaBridgeDispatcherHostManager(this)); |
| 309 #endif | 310 #endif |
| 311 |
| 312 browser_plugin_web_contents_observer_.reset( |
| 313 new content::BrowserPluginWebContentsObserver(this)); |
| 310 } | 314 } |
| 311 | 315 |
| 312 TabContents::~TabContents() { | 316 TabContents::~TabContents() { |
| 313 is_being_destroyed_ = true; | 317 is_being_destroyed_ = true; |
| 314 | 318 |
| 315 // Clear out any JavaScript state. | 319 // Clear out any JavaScript state. |
| 316 if (dialog_creator_) | 320 if (dialog_creator_) |
| 317 dialog_creator_->ResetJavaScriptState(this); | 321 dialog_creator_->ResetJavaScriptState(this); |
| 318 | 322 |
| 319 if (color_chooser_) | 323 if (color_chooser_) |
| (...skipping 2276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2596 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2600 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2597 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2601 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2598 // Can be NULL during tests. | 2602 // Can be NULL during tests. |
| 2599 if (rwh_view) | 2603 if (rwh_view) |
| 2600 rwh_view->SetSize(GetView()->GetContainerSize()); | 2604 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2601 } | 2605 } |
| 2602 | 2606 |
| 2603 RenderViewHostImpl* TabContents::GetRenderViewHostImpl() { | 2607 RenderViewHostImpl* TabContents::GetRenderViewHostImpl() { |
| 2604 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2608 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2605 } | 2609 } |
| OLD | NEW |