Index: chrome/browser/ui/uma_browsing_activity_observer.cc |
diff --git a/chrome/browser/ui/uma_browsing_activity_observer.cc b/chrome/browser/ui/uma_browsing_activity_observer.cc |
index 1db2777fd4a3f6bcbd54173997354c7f88d77eca..780ff5c508268a9dcb1bdd3eb945b24fefb3341f 100644 |
--- a/chrome/browser/ui/uma_browsing_activity_observer.cc |
+++ b/chrome/browser/ui/uma_browsing_activity_observer.cc |
@@ -6,14 +6,19 @@ |
#include "base/metrics/histogram.h" |
#include "chrome/browser/chrome_notification_types.h" |
+#include "chrome/browser/search_engines/template_url_service.h" |
+#include "chrome/browser/search_engines/template_url_service_factory.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/browser_finder.h" |
#include "chrome/browser/ui/browser_iterator.h" |
#include "chrome/browser/ui/browser_window.h" |
#include "chrome/browser/ui/tabs/tab_strip_model.h" |
+#include "content/public/browser/navigation_controller.h" |
#include "content/public/browser/navigation_details.h" |
+#include "content/public/browser/navigation_entry.h" |
#include "content/public/browser/notification_service.h" |
#include "content/public/browser/render_process_host.h" |
+#include "content/public/browser/user_metrics.h" |
namespace chrome { |
namespace { |
@@ -47,6 +52,20 @@ void UMABrowsingActivityObserver::Observe( |
if (type == content::NOTIFICATION_NAV_ENTRY_COMMITTED) { |
const content::LoadCommittedDetails& load = |
*content::Details<content::LoadCommittedDetails>(details).ptr(); |
+ |
+ content::NavigationController* controller = |
+ content::Source<content::NavigationController>(source).ptr(); |
+ // Track whether the page loaded is a search results page (SRP). Track |
+ // the non-SRP navigations as well so there is a control. |
+ content::RecordAction(content::UserMetricsAction("NavEntryCommitted")); |
+ if (TemplateURLServiceFactory::GetForProfile( |
+ Profile::FromBrowserContext(controller->GetBrowserContext()))-> |
+ IsSearchResultsPageFromDefaultSearchProvider( |
Mark P
2013/08/06 23:17:47
indent four less
ditto line below (or actually you
rpetterson
2013/08/06 23:41:31
I don't understand your comment. "load.entry->GetU
Mark P
2013/08/06 23:57:17
You indent more if you're at a deeper level than b
rpetterson
2013/08/07 00:18:24
Done. Sadly load.entry->GetURL() still doesn't fit
|
+ load.entry->GetURL())) { |
+ content::RecordAction( |
+ content::UserMetricsAction("NavEntryCommitted.SRP")); |
+ } |
+ |
if (!load.is_navigation_to_different_page()) |
return; // Don't log for subframes or other trivial types. |