| 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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.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" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 RenderWidgetHostViewPort::FromRWHV(host->GetView())->WillWmDestroy(); | 343 RenderWidgetHostViewPort::FromRWHV(host->GetView())->WillWmDestroy(); |
| 344 } | 344 } |
| 345 #endif | 345 #endif |
| 346 | 346 |
| 347 // OnCloseStarted isn't called in unit tests. | 347 // OnCloseStarted isn't called in unit tests. |
| 348 if (!tab_close_start_time_.is_null()) { | 348 if (!tab_close_start_time_.is_null()) { |
| 349 UMA_HISTOGRAM_TIMES("Tab.Close", | 349 UMA_HISTOGRAM_TIMES("Tab.Close", |
| 350 base::TimeTicks::Now() - tab_close_start_time_); | 350 base::TimeTicks::Now() - tab_close_start_time_); |
| 351 } | 351 } |
| 352 | 352 |
| 353 FOR_EACH_OBSERVER(WebContentsObserver, observers_, TabContentsDestroyed()); | 353 FOR_EACH_OBSERVER(WebContentsObserver, |
| 354 observers_, |
| 355 WebContentsImplDestroyed()); |
| 354 | 356 |
| 355 SetDelegate(NULL); | 357 SetDelegate(NULL); |
| 356 } | 358 } |
| 357 | 359 |
| 358 WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, | 360 WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, |
| 359 const GURL& url) { | 361 const GURL& url) { |
| 360 WebPreferences prefs; | 362 WebPreferences prefs; |
| 361 | 363 |
| 362 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 364 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 363 | 365 |
| (...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2617 void WebContentsImpl::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2616 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2618 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2617 // Can be NULL during tests. | 2619 // Can be NULL during tests. |
| 2618 if (rwh_view) | 2620 if (rwh_view) |
| 2619 rwh_view->SetSize(GetView()->GetContainerSize()); | 2621 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2620 } | 2622 } |
| 2621 | 2623 |
| 2622 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { | 2624 RenderViewHostImpl* WebContentsImpl::GetRenderViewHostImpl() { |
| 2623 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); | 2625 return static_cast<RenderViewHostImpl*>(GetRenderViewHost()); |
| 2624 } | 2626 } |
| OLD | NEW |