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/md_history_ui.h" | 5 #include "chrome/browser/ui/webui/md_history_ui.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/webui/browsing_history_handler.h" | 9 #include "chrome/browser/ui/webui/browsing_history_handler.h" |
| 10 #include "chrome/browser/ui/webui/metrics_handler.h" | 10 #include "chrome/browser/ui/webui/metrics_handler.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 #include "chrome/browser/ui/webui/history_login_handler.h" | 24 #include "chrome/browser/ui/webui/history_login_handler.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 content::WebUIDataSource* CreateMdHistoryUIHTMLSource() { | 29 content::WebUIDataSource* CreateMdHistoryUIHTMLSource() { |
| 30 content::WebUIDataSource* source = | 30 content::WebUIDataSource* source = |
| 31 content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); | 31 content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); |
| 32 | 32 |
| 33 // Localized strings (alphabetical order). | 33 // Localized strings (alphabetical order). |
| 34 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); | |
| 35 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); | |
| 34 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH); | 36 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH); |
| 35 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); | 37 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); |
| 36 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); | 38 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); |
| 37 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); | 39 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); |
| 38 source->AddLocalizedString("title", IDS_HISTORY_TITLE); | 40 source->AddLocalizedString("title", IDS_HISTORY_TITLE); |
| 41 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH); | |
| 42 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); | |
| 43 | |
|
calamity
2016/02/02 04:09:48
nit: stray newline.
yingran
2016/02/09 04:21:35
Done.
| |
| 39 | 44 |
| 40 source->AddResourcePath("history_card.html", | 45 source->AddResourcePath("history_card.html", |
| 41 IDR_MD_HISTORY_HISTORY_CARD_HTML); | 46 IDR_MD_HISTORY_HISTORY_CARD_HTML); |
| 42 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS); | 47 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS); |
| 43 source->AddResourcePath("history_card_manager.html", | 48 source->AddResourcePath("history_card_manager.html", |
| 44 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_HTML); | 49 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_HTML); |
| 45 source->AddResourcePath("history_card_manager.js", | 50 source->AddResourcePath("history_card_manager.js", |
| 46 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_JS); | 51 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_JS); |
| 47 source->AddResourcePath("history_item.html", | 52 source->AddResourcePath("history_item.html", |
| 48 IDR_MD_HISTORY_HISTORY_ITEM_HTML); | 53 IDR_MD_HISTORY_HISTORY_ITEM_HTML); |
| 49 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); | 54 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); |
| 50 source->AddResourcePath("history_toolbar.html", | 55 source->AddResourcePath("history_toolbar.html", |
| 51 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); | 56 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); |
| 52 source->AddResourcePath("history_toolbar.js", | 57 source->AddResourcePath("history_toolbar.js", |
| 53 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); | 58 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); |
| 54 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); | 59 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); |
| 60 source->AddResourcePath("side_bar.html", IDR_MD_HISTORY_SIDE_BAR_HTML); | |
| 61 source->AddResourcePath("side_bar.js", IDR_MD_HISTORY_SIDE_BAR_JS); | |
| 62 source->AddResourcePath("synced_device_card.html", | |
| 63 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_HTML); | |
| 64 source->AddResourcePath("synced_device_card.js", | |
| 65 IDR_MD_HISTORY_SYNCED_DEVICE_CARD_JS); | |
| 66 source->AddResourcePath("synced_device_manager.html", | |
| 67 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_HTML); | |
| 68 source->AddResourcePath("synced_device_manager.js", | |
| 69 IDR_MD_HISTORY_SYNCED_DEVICE_MANAGER_JS); | |
| 55 | 70 |
| 56 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); | 71 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); |
| 57 source->SetJsonPath("strings.js"); | 72 source->SetJsonPath("strings.js"); |
| 58 | 73 |
| 59 return source; | 74 return source; |
| 60 } | 75 } |
| 61 | 76 |
| 62 } // namespace | 77 } // namespace |
| 63 | 78 |
| 64 MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 79 MdHistoryUI::MdHistoryUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 77 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource()); | 92 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource()); |
| 78 } | 93 } |
| 79 | 94 |
| 80 MdHistoryUI::~MdHistoryUI() {} | 95 MdHistoryUI::~MdHistoryUI() {} |
| 81 | 96 |
| 82 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( | 97 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( |
| 83 ui::ScaleFactor scale_factor) { | 98 ui::ScaleFactor scale_factor) { |
| 84 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 99 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 85 IDR_HISTORY_FAVICON, scale_factor); | 100 IDR_HISTORY_FAVICON, scale_factor); |
| 86 } | 101 } |
| OLD | NEW |