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

Side by Side Diff: chrome/browser/ui/webui/settings/md_settings_ui.cc

Issue 2313103002: Added uma for pin unlock set up. (Closed)
Patch Set: Closure compiler fix. Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/settings/md_settings_ui.h" 5 #include "chrome/browser/ui/webui/settings/md_settings_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/webui/metrics_handler.h"
13 #include "chrome/browser/ui/webui/settings/about_handler.h" 14 #include "chrome/browser/ui/webui/settings/about_handler.h"
14 #include "chrome/browser/ui/webui/settings/appearance_handler.h" 15 #include "chrome/browser/ui/webui/settings/appearance_handler.h"
15 #include "chrome/browser/ui/webui/settings/browser_lifetime_handler.h" 16 #include "chrome/browser/ui/webui/settings/browser_lifetime_handler.h"
16 #include "chrome/browser/ui/webui/settings/downloads_handler.h" 17 #include "chrome/browser/ui/webui/settings/downloads_handler.h"
17 #include "chrome/browser/ui/webui/settings/extension_control_handler.h" 18 #include "chrome/browser/ui/webui/settings/extension_control_handler.h"
18 #include "chrome/browser/ui/webui/settings/font_handler.h" 19 #include "chrome/browser/ui/webui/settings/font_handler.h"
19 #include "chrome/browser/ui/webui/settings/languages_handler.h" 20 #include "chrome/browser/ui/webui/settings/languages_handler.h"
20 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h" 21 #include "chrome/browser/ui/webui/settings/md_settings_localized_strings_provide r.h"
21 #include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h" 22 #include "chrome/browser/ui/webui/settings/metrics_reporting_handler.h"
22 #include "chrome/browser/ui/webui/settings/on_startup_handler.h" 23 #include "chrome/browser/ui/webui/settings/on_startup_handler.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 chromeos::IsPinUnlockEnabled(profile->GetPrefs())); 141 chromeos::IsPinUnlockEnabled(profile->GetPrefs()));
141 html_source->AddBoolean( 142 html_source->AddBoolean(
142 "androidAppsAllowed", 143 "androidAppsAllowed",
143 arc::ArcSessionManager::IsAllowedForProfile(profile) && 144 arc::ArcSessionManager::IsAllowedForProfile(profile) &&
144 !arc::ArcSessionManager::IsOptInVerificationDisabled()); 145 !arc::ArcSessionManager::IsOptInVerificationDisabled());
145 #endif 146 #endif
146 147
147 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile)); 148 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile));
148 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile)); 149 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile));
149 150
151 // Add the metrics handler to write uma stats.
152 web_ui->AddMessageHandler(new MetricsHandler());
153
150 // Add all settings resources. 154 // Add all settings resources.
151 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { 155 for (size_t i = 0; i < kSettingsResourcesSize; ++i) {
152 html_source->AddResourcePath(kSettingsResources[i].name, 156 html_source->AddResourcePath(kSettingsResources[i].name,
153 kSettingsResources[i].value); 157 kSettingsResources[i].value);
154 } 158 }
155 159
156 AddLocalizedStrings(html_source, profile); 160 AddLocalizedStrings(html_source, profile);
157 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML); 161 html_source->SetDefaultResource(IDR_SETTINGS_SETTINGS_HTML);
158 162
159 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(), 163 content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
(...skipping 21 matching lines...) Expand all
181 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", 185 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD",
182 base::Time::Now() - load_start_time_); 186 base::Time::Now() - load_start_time_);
183 } 187 }
184 188
185 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { 189 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() {
186 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", 190 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD",
187 base::Time::Now() - load_start_time_); 191 base::Time::Now() - load_start_time_);
188 } 192 }
189 193
190 } // namespace settings 194 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/options_ui.cc ('k') | chrome/test/data/webui/settings/cr_settings_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698