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

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

Issue 2354613002: [Sync] Fix namespaces for the browser_sync component. (Closed)
Patch Set: Address comments. Created 4 years, 2 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 number_of_tiles_(0), 179 number_of_tiles_(0),
180 has_emitted_(false), 180 has_emitted_(false),
181 during_startup_(false) { 181 during_startup_(false) {
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 browser_sync::ProfileSyncService* sync =
190 Profile::FromBrowserContext(contents->GetBrowserContext())); 190 ProfileSyncServiceFactory::GetForProfile(
191 Profile::FromBrowserContext(contents->GetBrowserContext()));
191 if (sync) { 192 if (sync) {
192 sync_sessions::SessionsSyncManager* sessions = 193 sync_sessions::SessionsSyncManager* sessions =
193 static_cast<sync_sessions::SessionsSyncManager*>( 194 static_cast<sync_sessions::SessionsSyncManager*>(
194 sync->GetSessionsSyncableService()); 195 sync->GetSessionsSyncableService());
195 if (sessions) { 196 if (sessions) {
196 sync_sessions::SyncSessionsMetrics::RecordYoungestForeignTabAgeOnNTP( 197 sync_sessions::SyncSessionsMetrics::RecordYoungestForeignTabAgeOnNTP(
197 sessions); 198 sessions);
198 } 199 }
199 } 200 }
200 } 201 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 244
244 has_server_side_suggestions_ = false; 245 has_server_side_suggestions_ = false;
245 has_client_side_suggestions_ = false; 246 has_client_side_suggestions_ = false;
246 UMA_HISTOGRAM_CUSTOM_COUNTS( 247 UMA_HISTOGRAM_CUSTOM_COUNTS(
247 "NewTabPage.NumberOfTiles", number_of_tiles_, 1, kNumMostVisited, 248 "NewTabPage.NumberOfTiles", number_of_tiles_, 1, kNumMostVisited,
248 kNumMostVisited + 1); 249 kNumMostVisited + 1);
249 number_of_tiles_ = 0; 250 number_of_tiles_ = 0;
250 has_emitted_ = true; 251 has_emitted_ = true;
251 during_startup_ = false; 252 during_startup_ = false;
252 } 253 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/foreign_session_handler.cc ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698