Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Side by Side Diff: chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc

Issue 2343463003: [Sync] Fix namespaces for the sync_sessions component. (Closed)
Patch Set: Fix Android. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/webui/ntp/ntp_user_data_logger.h" 5 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 during_startup_ = !AfterStartupTaskUtils::IsBrowserStartupComplete(); 182 during_startup_ = !AfterStartupTaskUtils::IsBrowserStartupComplete();
183 183
184 // We record metrics about session data here because when this class typically 184 // We record metrics about session data here because when this class typically
185 // emits metrics it is too late. This session data would theoretically have 185 // emits metrics it is too late. This session data would theoretically have
186 // been used to populate the page, and we want to learn about its state when 186 // been used to populate the page, and we want to learn about its state when
187 // the NTP is being generated. 187 // the NTP is being generated.
188 if (contents) { 188 if (contents) {
189 ProfileSyncService* sync = ProfileSyncServiceFactory::GetForProfile( 189 ProfileSyncService* sync = ProfileSyncServiceFactory::GetForProfile(
190 Profile::FromBrowserContext(contents->GetBrowserContext())); 190 Profile::FromBrowserContext(contents->GetBrowserContext()));
191 if (sync) { 191 if (sync) {
192 browser_sync::SessionsSyncManager* sessions = 192 sync_sessions::SessionsSyncManager* sessions =
193 static_cast<browser_sync::SessionsSyncManager*>( 193 static_cast<sync_sessions::SessionsSyncManager*>(
194 sync->GetSessionsSyncableService()); 194 sync->GetSessionsSyncableService());
195 if (sessions) { 195 if (sessions) {
196 sync_sessions::SyncSessionsMetrics::RecordYoungestForeignTabAgeOnNTP( 196 sync_sessions::SyncSessionsMetrics::RecordYoungestForeignTabAgeOnNTP(
197 sessions); 197 sessions);
198 } 198 }
199 } 199 }
200 } 200 }
201 } 201 }
202 202
203 // content::WebContentsObserver override 203 // content::WebContentsObserver override
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 has_server_side_suggestions_ = false; 244 has_server_side_suggestions_ = false;
245 has_client_side_suggestions_ = false; 245 has_client_side_suggestions_ = false;
246 UMA_HISTOGRAM_CUSTOM_COUNTS( 246 UMA_HISTOGRAM_CUSTOM_COUNTS(
247 "NewTabPage.NumberOfTiles", number_of_tiles_, 1, kNumMostVisited, 247 "NewTabPage.NumberOfTiles", number_of_tiles_, 1, kNumMostVisited,
248 kNumMostVisited + 1); 248 kNumMostVisited + 1);
249 number_of_tiles_ = 0; 249 number_of_tiles_ = 0;
250 has_emitted_ = true; 250 has_emitted_ = true;
251 during_startup_ = false; 251 during_startup_ = false;
252 } 252 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698