| 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 29 matching lines...) Expand all Loading... |
| 40 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE); | 40 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE); |
| 41 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED); | 41 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED); |
| 42 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); | 42 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); |
| 43 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); | 43 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); |
| 44 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); | 44 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); |
| 45 source->AddLocalizedString("title", IDS_HISTORY_TITLE); | 45 source->AddLocalizedString("title", IDS_HISTORY_TITLE); |
| 46 | 46 |
| 47 bool allow_deleting_history = | 47 bool allow_deleting_history = |
| 48 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); | 48 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| 49 source->AddBoolean("allowDeletingHistory", allow_deleting_history); | 49 source->AddBoolean("allowDeletingHistory", allow_deleting_history); |
| 50 | |
| 51 source->AddResourcePath("history_card.html", | |
| 52 IDR_MD_HISTORY_HISTORY_CARD_HTML); | |
| 53 source->AddResourcePath("history_card.js", IDR_MD_HISTORY_HISTORY_CARD_JS); | |
| 54 source->AddResourcePath("history_card_manager.html", | |
| 55 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_HTML); | |
| 56 source->AddResourcePath("history_card_manager.js", | |
| 57 IDR_MD_HISTORY_HISTORY_CARD_MANAGER_JS); | |
| 58 source->AddResourcePath("history_item.html", | 50 source->AddResourcePath("history_item.html", |
| 59 IDR_MD_HISTORY_HISTORY_ITEM_HTML); | 51 IDR_MD_HISTORY_HISTORY_ITEM_HTML); |
| 60 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); | 52 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); |
| 53 source->AddResourcePath("history_list.html", |
| 54 IDR_MD_HISTORY_HISTORY_LIST_HTML); |
| 55 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); |
| 61 source->AddResourcePath("history_toolbar.html", | 56 source->AddResourcePath("history_toolbar.html", |
| 62 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); | 57 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); |
| 63 source->AddResourcePath("history_toolbar.js", | 58 source->AddResourcePath("history_toolbar.js", |
| 64 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); | 59 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); |
| 65 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); | 60 source->AddResourcePath("history.js", IDR_MD_HISTORY_HISTORY_JS); |
| 66 | 61 |
| 67 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); | 62 source->SetDefaultResource(IDR_MD_HISTORY_HISTORY_HTML); |
| 68 source->SetJsonPath("strings.js"); | 63 source->SetJsonPath("strings.js"); |
| 69 | 64 |
| 70 return source; | 65 return source; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 88 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); | 83 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); |
| 89 } | 84 } |
| 90 | 85 |
| 91 MdHistoryUI::~MdHistoryUI() {} | 86 MdHistoryUI::~MdHistoryUI() {} |
| 92 | 87 |
| 93 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( | 88 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( |
| 94 ui::ScaleFactor scale_factor) { | 89 ui::ScaleFactor scale_factor) { |
| 95 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 90 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 96 IDR_HISTORY_FAVICON, scale_factor); | 91 IDR_HISTORY_FAVICON, scale_factor); |
| 97 } | 92 } |
| OLD | NEW |