| 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/tab_contents/navigation_metrics_recorder.h" |   5 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 
|   6  |   6  | 
|   7 #include "base/metrics/histogram.h" |   7 #include "base/metrics/histogram.h" | 
|   8 #include "components/navigation_metrics/navigation_metrics.h" |   8 #include "components/navigation_metrics/navigation_metrics.h" | 
|   9 #include "content/public/browser/navigation_details.h" |   9 #include "content/public/browser/navigation_details.h" | 
|  10 #include "content/public/browser/navigation_entry.h" |  10 #include "content/public/browser/navigation_entry.h" | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
|  26 NavigationMetricsRecorder::~NavigationMetricsRecorder() { |  26 NavigationMetricsRecorder::~NavigationMetricsRecorder() { | 
|  27 } |  27 } | 
|  28  |  28  | 
|  29 void NavigationMetricsRecorder::DidNavigateMainFrame( |  29 void NavigationMetricsRecorder::DidNavigateMainFrame( | 
|  30       const content::LoadCommittedDetails& details, |  30       const content::LoadCommittedDetails& details, | 
|  31       const content::FrameNavigateParams& params) { |  31       const content::FrameNavigateParams& params) { | 
|  32   navigation_metrics::RecordMainFrameNavigation(details.entry->GetVirtualURL(), |  32   navigation_metrics::RecordMainFrameNavigation(details.entry->GetVirtualURL(), | 
|  33                                                 details.is_in_page); |  33                                                 details.is_in_page); | 
|  34 } |  34 } | 
|  35  |  35  | 
|  36 void NavigationMetricsRecorder::DidStartLoading( |  36 void NavigationMetricsRecorder::DidStartLoading() { | 
|  37     content::RenderViewHost* render_view_host) { |  | 
|  38 #if defined(OS_WIN) && defined(USE_ASH) |  37 #if defined(OS_WIN) && defined(USE_ASH) | 
|  39   if (render_view_host && base::win::GetVersion() >= base::win::VERSION_WIN8) { |  38   content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); | 
|  40     content::RenderWidgetHostView* rwhv = render_view_host->GetView(); |  39  | 
 |  40   if (rvh && base::win::GetVersion() >= base::win::VERSION_WIN8) { | 
 |  41     content::RenderWidgetHostView* rwhv = rvh->GetView(); | 
|  41     if (rwhv) { |  42     if (rwhv) { | 
|  42       gfx::NativeView native_view = rwhv->GetNativeView(); |  43       gfx::NativeView native_view = rwhv->GetNativeView(); | 
|  43       if (native_view) { |  44       if (native_view) { | 
|  44         chrome::HostDesktopType desktop = |  45         chrome::HostDesktopType desktop = | 
|  45             chrome::GetHostDesktopTypeForNativeView(native_view); |  46             chrome::GetHostDesktopTypeForNativeView(native_view); | 
|  46         UMA_HISTOGRAM_ENUMERATION("Win8.PageLoad", |  47         UMA_HISTOGRAM_ENUMERATION("Win8.PageLoad", | 
|  47                                   chrome::GetWin8Environment(desktop), |  48                                   chrome::GetWin8Environment(desktop), | 
|  48                                   chrome::WIN_8_ENVIRONMENT_MAX); |  49                                   chrome::WIN_8_ENVIRONMENT_MAX); | 
|  49       } |  50       } | 
|  50     } |  51     } | 
|  51   } |  52   } | 
|  52 #endif |  53 #endif | 
|  53 } |  54 } | 
|  54  |  | 
|  55  |  | 
| OLD | NEW |