Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 26 matching lines...) Expand all Loading... | |
| 37 #endif // defined(OS_CHROMEOS) | 37 #endif // defined(OS_CHROMEOS) |
| 38 | 38 |
| 39 namespace settings { | 39 namespace settings { |
| 40 | 40 |
| 41 SettingsPageUIHandler::SettingsPageUIHandler() { | 41 SettingsPageUIHandler::SettingsPageUIHandler() { |
| 42 } | 42 } |
| 43 | 43 |
| 44 SettingsPageUIHandler::~SettingsPageUIHandler() { | 44 SettingsPageUIHandler::~SettingsPageUIHandler() { |
| 45 } | 45 } |
| 46 | 46 |
| 47 void SettingsPageUIHandler::CallJavascriptCallback( | 47 void SettingsPageUIHandler::CallJavascriptCallback( |
|
Dan Beam
2016/03/03 19:04:51
maybe we could just introduce 2 methods, ResolveCa
dpapad
2016/03/03 19:51:53
Done.
| |
| 48 const base::Value& callback_id, const base::Value& response) { | 48 const base::Value& callback_id, |
| 49 bool is_success, | |
| 50 const base::Value& response) { | |
| 49 // cr.webUIResponse is a global JS function exposed from cr.js. | 51 // cr.webUIResponse is a global JS function exposed from cr.js. |
| 50 web_ui()->CallJavascriptFunction("cr.webUIResponse", callback_id, response); | 52 web_ui()->CallJavascriptFunction( |
| 53 "cr.webUIResponse", callback_id, | |
| 54 base::FundamentalValue(is_success), response); | |
| 51 } | 55 } |
| 52 | 56 |
| 53 MdSettingsUI::MdSettingsUI(content::WebUI* web_ui) | 57 MdSettingsUI::MdSettingsUI(content::WebUI* web_ui) |
| 54 : content::WebUIController(web_ui), | 58 : content::WebUIController(web_ui), |
| 55 WebContentsObserver(web_ui->GetWebContents()) { | 59 WebContentsObserver(web_ui->GetWebContents()) { |
| 56 Profile* profile = Profile::FromWebUI(web_ui); | 60 Profile* profile = Profile::FromWebUI(web_ui); |
| 57 AddSettingsPageUIHandler(new AppearanceHandler(web_ui)); | 61 AddSettingsPageUIHandler(new AppearanceHandler(web_ui)); |
| 58 AddSettingsPageUIHandler(new ClearBrowsingDataHandler(web_ui)); | 62 AddSettingsPageUIHandler(new ClearBrowsingDataHandler(web_ui)); |
| 59 AddSettingsPageUIHandler(new DownloadsHandler()); | 63 AddSettingsPageUIHandler(new DownloadsHandler()); |
| 60 AddSettingsPageUIHandler(new FontHandler(web_ui)); | 64 AddSettingsPageUIHandler(new FontHandler(web_ui)); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", | 125 UMA_HISTOGRAM_TIMES("Settings.LoadDocumentTime.MD", |
| 122 base::Time::Now() - load_start_time_); | 126 base::Time::Now() - load_start_time_); |
| 123 } | 127 } |
| 124 | 128 |
| 125 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { | 129 void MdSettingsUI::DocumentOnLoadCompletedInMainFrame() { |
| 126 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", | 130 UMA_HISTOGRAM_TIMES("Settings.LoadCompletedTime.MD", |
| 127 base::Time::Now() - load_start_time_); | 131 base::Time::Now() - load_start_time_); |
| 128 } | 132 } |
| 129 | 133 |
| 130 } // namespace settings | 134 } // namespace settings |
| OLD | NEW |