Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
|
dhollowa
2012/12/13 01:20:15
nit: no (c)
Shishir
2012/12/13 22:57:58
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_ui.h" | |
| 6 | |
| 7 #include "chrome/browser/profiles/profile.h" | |
| 8 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | |
| 9 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | |
| 10 #include "chrome/browser/ui/webui/local_omnibox_popup/local_omnibox_popup_handle r.h" | |
| 11 #include "chrome/common/url_constants.h" | |
| 12 #include "content/public/browser/web_ui.h" | |
| 13 #include "content/public/browser/web_ui_controller.h" | |
| 14 #include "grit/browser_resources.h" | |
| 15 | |
| 16 | |
| 17 LocalOmniboxPopupUI::LocalOmniboxPopupUI(content::WebUI* web_ui) | |
| 18 : content::WebUIController(web_ui) { | |
| 19 ChromeWebUIDataSource* html_source = | |
| 20 new ChromeWebUIDataSource(chrome::kChromeUILocalOmniboxPopupHost); | |
| 21 html_source->add_resource_path("local_omnibox_popup.css", | |
| 22 IDR_LOCAL_OMNIBOX_POPUP_CSS); | |
| 23 html_source->add_resource_path("local_omnibox_popup.js", | |
| 24 IDR_LOCAL_OMNIBOX_POPUP_JS); | |
| 25 html_source->set_default_resource(IDR_LOCAL_OMNIBOX_POPUP_HTML); | |
| 26 | |
| 27 Profile* profile = Profile::FromWebUI(web_ui); | |
| 28 ChromeURLDataManager::AddDataSource(profile, html_source); | |
| 29 | |
| 30 web_ui->AddMessageHandler(new LocalOmniboxPopupHandler(profile)); | |
| 31 } | |
| 32 | |
| 33 LocalOmniboxPopupUI::~LocalOmniboxPopupUI() { | |
| 34 } | |
| OLD | NEW |