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

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

Issue 2178213002: Add note page to settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylus-add-switch
Patch Set: Address comments and add utility method Created 4 years, 4 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 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
(...skipping 18 matching lines...) Expand all
29 #include "chrome/browser/ui/webui/settings/settings_startup_pages_handler.h" 29 #include "chrome/browser/ui/webui/settings/settings_startup_pages_handler.h"
30 #include "chrome/browser/ui/webui/settings/site_settings_handler.h" 30 #include "chrome/browser/ui/webui/settings/site_settings_handler.h"
31 #include "chrome/common/url_constants.h" 31 #include "chrome/common/url_constants.h"
32 #include "content/public/browser/web_contents.h" 32 #include "content/public/browser/web_contents.h"
33 #include "content/public/browser/web_ui.h" 33 #include "content/public/browser/web_ui.h"
34 #include "content/public/browser/web_ui_data_source.h" 34 #include "content/public/browser/web_ui_data_source.h"
35 #include "grit/settings_resources.h" 35 #include "grit/settings_resources.h"
36 #include "grit/settings_resources_map.h" 36 #include "grit/settings_resources_map.h"
37 37
38 #if defined(OS_CHROMEOS) 38 #if defined(OS_CHROMEOS)
39 #include "ash/common/system/chromeos/palette/palette_utils.h"
39 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" 40 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
40 #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.h" 41 #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.h"
41 #include "chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h" 42 #include "chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.h"
42 #include "chrome/browser/ui/webui/settings/chromeos/device_pointer_handler.h" 43 #include "chrome/browser/ui/webui/settings/chromeos/device_pointer_handler.h"
43 #include "chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler .h" 44 #include "chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler .h"
44 #else // !defined(OS_CHROMEOS) 45 #else // !defined(OS_CHROMEOS)
45 #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h" 46 #include "chrome/browser/ui/webui/settings/settings_default_browser_handler.h"
46 #include "chrome/browser/ui/webui/settings/settings_manage_profile_handler.h" 47 #include "chrome/browser/ui/webui/settings/settings_manage_profile_handler.h"
47 #include "chrome/browser/ui/webui/settings/system_handler.h" 48 #include "chrome/browser/ui/webui/settings/system_handler.h"
48 #endif // defined(OS_CHROMEOS) 49 #endif // defined(OS_CHROMEOS)
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 content::WebUIDataSource* html_source = 100 content::WebUIDataSource* html_source =
100 content::WebUIDataSource::Create(url.host()); 101 content::WebUIDataSource::Create(url.host());
101 102
102 #if defined(OS_CHROMEOS) 103 #if defined(OS_CHROMEOS)
103 chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler = 104 chromeos::settings::EasyUnlockSettingsHandler* easy_unlock_handler =
104 chromeos::settings::EasyUnlockSettingsHandler::Create(html_source, 105 chromeos::settings::EasyUnlockSettingsHandler::Create(html_source,
105 profile); 106 profile);
106 if (easy_unlock_handler) 107 if (easy_unlock_handler)
107 AddSettingsPageUIHandler(easy_unlock_handler); 108 AddSettingsPageUIHandler(easy_unlock_handler);
108 109
110 html_source->AddBoolean("noteAllowed", ash::IsPaletteEnabled());
109 html_source->AddBoolean("quickUnlockEnabled", 111 html_source->AddBoolean("quickUnlockEnabled",
110 chromeos::IsQuickUnlockEnabled()); 112 chromeos::IsQuickUnlockEnabled());
111 #endif 113 #endif
112 114
113 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile)); 115 AddSettingsPageUIHandler(AboutHandler::Create(html_source, profile));
114 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile)); 116 AddSettingsPageUIHandler(ResetSettingsHandler::Create(html_source, profile));
115 117
116 // Add all settings resources. 118 // Add all settings resources.
117 for (size_t i = 0; i < kSettingsResourcesSize; ++i) { 119 for (size_t i = 0; i < kSettingsResourcesSize; ++i) {
118 html_source->AddResourcePath(kSettingsResources[i].name, 120 html_source->AddResourcePath(kSettingsResources[i].name,
(...skipping 29 matching lines...) Expand all
148 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", 150 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD",
149 base::Time::Now() - load_start_time_); 151 base::Time::Now() - load_start_time_);
150 } 152 }
151 153
152 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { 154 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() {
153 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", 155 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD",
154 base::Time::Now() - load_start_time_); 156 base::Time::Now() - load_start_time_);
155 } 157 }
156 158
157 } // namespace settings 159 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698