| 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/foreign_session_handler.h" | 10 #include "chrome/browser/ui/webui/foreign_session_handler.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 source->AddLocalizedString("noSearchResults", IDS_HISTORY_NO_SEARCH_RESULTS); | 51 source->AddLocalizedString("noSearchResults", IDS_HISTORY_NO_SEARCH_RESULTS); |
| 52 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); | 52 source->AddLocalizedString("removeFromHistory", IDS_HISTORY_REMOVE_PAGE); |
| 53 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); | 53 source->AddLocalizedString("search", IDS_MD_HISTORY_SEARCH); |
| 54 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT); | 54 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT); |
| 55 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS); | 55 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS); |
| 56 source->AddLocalizedString("title", IDS_HISTORY_TITLE); | 56 source->AddLocalizedString("title", IDS_HISTORY_TITLE); |
| 57 | 57 |
| 58 bool allow_deleting_history = | 58 bool allow_deleting_history = |
| 59 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); | 59 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| 60 source->AddBoolean("allowDeletingHistory", allow_deleting_history); | 60 source->AddBoolean("allowDeletingHistory", allow_deleting_history); |
| 61 source->AddResourcePath("app.html", IDR_MD_HISTORY_APP_HTML); |
| 62 source->AddResourcePath("app.js", IDR_MD_HISTORY_APP_JS); |
| 61 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML); | 63 source->AddResourcePath("constants.html", IDR_MD_HISTORY_CONSTANTS_HTML); |
| 62 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS); | 64 source->AddResourcePath("constants.js", IDR_MD_HISTORY_CONSTANTS_JS); |
| 63 source->AddResourcePath("elements.html", IDR_MD_HISTORY_ELEMENTS_HTML); | |
| 64 source->AddResourcePath("history_item.html", | 65 source->AddResourcePath("history_item.html", |
| 65 IDR_MD_HISTORY_HISTORY_ITEM_HTML); | 66 IDR_MD_HISTORY_HISTORY_ITEM_HTML); |
| 66 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); | 67 source->AddResourcePath("history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS); |
| 67 source->AddResourcePath("history_list.html", | 68 source->AddResourcePath("history_list.html", |
| 68 IDR_MD_HISTORY_HISTORY_LIST_HTML); | 69 IDR_MD_HISTORY_HISTORY_LIST_HTML); |
| 69 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); | 70 source->AddResourcePath("history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS); |
| 70 source->AddResourcePath("history_toolbar.html", | 71 source->AddResourcePath("history_toolbar.html", |
| 71 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); | 72 IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML); |
| 72 source->AddResourcePath("history_toolbar.js", | 73 source->AddResourcePath("history_toolbar.js", |
| 73 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); | 74 IDR_MD_HISTORY_HISTORY_TOOLBAR_JS); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); | 107 content::WebUIDataSource::Add(profile, CreateMdHistoryUIHTMLSource(profile)); |
| 107 } | 108 } |
| 108 | 109 |
| 109 MdHistoryUI::~MdHistoryUI() {} | 110 MdHistoryUI::~MdHistoryUI() {} |
| 110 | 111 |
| 111 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( | 112 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( |
| 112 ui::ScaleFactor scale_factor) { | 113 ui::ScaleFactor scale_factor) { |
| 113 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 114 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 114 IDR_HISTORY_FAVICON, scale_factor); | 115 IDR_HISTORY_FAVICON, scale_factor); |
| 115 } | 116 } |
| OLD | NEW |