This source file includes following definitions.
- CreatePredictorsUIHTMLSource
#include "chrome/browser/ui/webui/predictors/predictors_ui.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/predictors/predictors_handler.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "grit/browser_resources.h"
namespace {
content::WebUIDataSource* CreatePredictorsUIHTMLSource() {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUIPredictorsHost);
source->AddResourcePath("predictors.js", IDR_PREDICTORS_JS);
source->SetDefaultResource(IDR_PREDICTORS_HTML);
return source;
}
}
PredictorsUI::PredictorsUI(content::WebUI* web_ui) : WebUIController(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui);
web_ui->AddMessageHandler(new PredictorsHandler(profile));
content::WebUIDataSource::Add(profile, CreatePredictorsUIHTMLSource());
}