This source file includes following definitions.
- CreateInvalidationsHTMLSource
#include "chrome/browser/ui/webui/invalidations_ui.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/invalidations_message_handler.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/browser/web_ui_message_handler.h"
#include "grit/invalidations_resources.h"
content::WebUIDataSource* CreateInvalidationsHTMLSource() {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(chrome::kChromeUIInvalidationsHost);
source->AddResourcePath("about_invalidations.js", IDR_ABOUT_INVALIDATIONS_JS);
source->SetDefaultResource(IDR_ABOUT_INVALIDATIONS_HTML);
return source;
}
InvalidationsUI::InvalidationsUI(content::WebUI* web_ui)
: WebUIController(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui);
if (profile) {
content::WebUIDataSource::Add(profile, CreateInvalidationsHTMLSource());
InvalidationsMessageHandler* message_handler =
new InvalidationsMessageHandler();
web_ui->AddMessageHandler(message_handler);
}
}
InvalidationsUI::~InvalidationsUI() { }