| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 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* source = new ChromeWebUIDataSource( |
| 20 chrome::kChromeUILocalOmniboxPopupHost); |
| 21 source->add_resource_path("local_omnibox_popup.css", |
| 22 IDR_LOCAL_OMNIBOX_POPUP_CSS); |
| 23 source->add_resource_path("local_omnibox_popup.js", |
| 24 IDR_LOCAL_OMNIBOX_POPUP_JS); |
| 25 source->add_resource_path("local_omnibox_popup.js", |
| 26 IDR_LOCAL_OMNIBOX_POPUP_JS); |
| 27 |
| 28 source->add_resource_path("images/history_icon.png", |
| 29 IDR_LOCAL_OMNIBOX_POPUP_IMAGES_HISTORY_ICON_PNG); |
| 30 source->add_resource_path("images/page_icon.png", |
| 31 IDR_LOCAL_OMNIBOX_POPUP_IMAGES_PAGE_ICON_PNG); |
| 32 source->add_resource_path("images/search_icon.png", |
| 33 IDR_LOCAL_OMNIBOX_POPUP_IMAGES_SEARCH_ICON_PNG); |
| 34 source->add_resource_path("images/2x/history_icon.png", |
| 35 IDR_LOCAL_OMNIBOX_POPUP_IMAGES_2X_HISTORY_ICON_PNG); |
| 36 source->add_resource_path("images/2x/page_icon.png", |
| 37 IDR_LOCAL_OMNIBOX_POPUP_IMAGES_2X_PAGE_ICON_PNG); |
| 38 source->add_resource_path("images/2x/search_icon.png", |
| 39 IDR_LOCAL_OMNIBOX_POPUP_IMAGES_2X_SEARCH_ICON_PNG); |
| 40 |
| 41 source->set_default_resource(IDR_LOCAL_OMNIBOX_POPUP_HTML); |
| 42 |
| 43 Profile* profile = Profile::FromWebUI(web_ui); |
| 44 ChromeURLDataManager::AddDataSource(profile, source); |
| 45 |
| 46 web_ui->AddMessageHandler(new LocalOmniboxPopupHandler(profile)); |
| 47 } |
| 48 |
| 49 LocalOmniboxPopupUI::~LocalOmniboxPopupUI() { |
| 50 } |
| OLD | NEW |