| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
| 11 #include "chrome/browser/ui/webui/browsing_history_handler.h" | 11 #include "chrome/browser/ui/webui/browsing_history_handler.h" |
| 12 #include "chrome/browser/ui/webui/foreign_session_handler.h" | 12 #include "chrome/browser/ui/webui/foreign_session_handler.h" |
| 13 #include "chrome/browser/ui/webui/history_login_handler.h" | 13 #include "chrome/browser/ui/webui/history_login_handler.h" |
| 14 #include "chrome/browser/ui/webui/history_ui.h" | |
| 15 #include "chrome/browser/ui/webui/metrics_handler.h" | 14 #include "chrome/browser/ui/webui/metrics_handler.h" |
| 16 #include "chrome/browser/ui/webui/settings/people_handler.h" | 15 #include "chrome/browser/ui/webui/settings/people_handler.h" |
| 17 #include "chrome/common/chrome_features.h" | 16 #include "chrome/common/chrome_features.h" |
| 18 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 20 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 21 #include "chrome/grit/locale_settings.h" | 20 #include "chrome/grit/locale_settings.h" |
| 22 #include "components/prefs/pref_service.h" | 21 #include "components/prefs/pref_service.h" |
| 23 #include "components/search/search.h" | 22 #include "components/search/search.h" |
| 24 #include "components/signin/core/browser/signin_manager.h" | 23 #include "components/signin/core/browser/signin_manager.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); | 40 content::WebUIDataSource::Create(chrome::kChromeUIHistoryHost); |
| 42 | 41 |
| 43 // Localized strings (alphabetical order). | 42 // Localized strings (alphabetical order). |
| 44 source->AddLocalizedString("cancel", IDS_CANCEL); | 43 source->AddLocalizedString("cancel", IDS_CANCEL); |
| 45 source->AddLocalizedString("clearBrowsingData", | 44 source->AddLocalizedString("clearBrowsingData", |
| 46 IDS_CLEAR_BROWSING_DATA_TITLE); | 45 IDS_CLEAR_BROWSING_DATA_TITLE); |
| 47 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH); | 46 source->AddLocalizedString("clearSearch", IDS_MD_HISTORY_CLEAR_SEARCH); |
| 48 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE); | 47 source->AddLocalizedString("delete", IDS_MD_HISTORY_DELETE); |
| 49 source->AddLocalizedString("deleteConfirm", | 48 source->AddLocalizedString("deleteConfirm", |
| 50 IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON); | 49 IDS_HISTORY_DELETE_PRIOR_VISITS_CONFIRM_BUTTON); |
| 50 source->AddLocalizedString( |
| 51 "deleteWarning", IDS_HISTORY_DELETE_PRIOR_VISITS_WARNING_NO_INCOGNITO); |
| 51 source->AddLocalizedString("foundSearchResults", | 52 source->AddLocalizedString("foundSearchResults", |
| 52 IDS_HISTORY_FOUND_SEARCH_RESULTS); | 53 IDS_HISTORY_FOUND_SEARCH_RESULTS); |
| 53 source->AddLocalizedString("historyInterval", IDS_HISTORY_INTERVAL); | 54 source->AddLocalizedString("historyInterval", IDS_HISTORY_INTERVAL); |
| 54 source->AddLocalizedString("historyMenuItem", | 55 source->AddLocalizedString("historyMenuItem", |
| 55 IDS_MD_HISTORY_HISTORY_MENU_ITEM); | 56 IDS_MD_HISTORY_HISTORY_MENU_ITEM); |
| 56 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED); | 57 source->AddLocalizedString("itemsSelected", IDS_MD_HISTORY_ITEMS_SELECTED); |
| 57 source->AddLocalizedString("loading", IDS_HISTORY_LOADING); | 58 source->AddLocalizedString("loading", IDS_HISTORY_LOADING); |
| 58 source->AddLocalizedString("moreActionsButton", | 59 source->AddLocalizedString("moreActionsButton", |
| 59 IDS_HISTORY_ACTION_MENU_DESCRIPTION); | 60 IDS_HISTORY_ACTION_MENU_DESCRIPTION); |
| 60 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); | 61 source->AddLocalizedString("moreFromSite", IDS_HISTORY_MORE_FROM_SITE); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 77 IDS_HISTORY_REMOVE_SELECTED_ITEMS); | 78 IDS_HISTORY_REMOVE_SELECTED_ITEMS); |
| 78 source->AddLocalizedString("searchPrompt", IDS_MD_HISTORY_SEARCH_PROMPT); | 79 source->AddLocalizedString("searchPrompt", IDS_MD_HISTORY_SEARCH_PROMPT); |
| 79 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT); | 80 source->AddLocalizedString("searchResult", IDS_HISTORY_SEARCH_RESULT); |
| 80 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS); | 81 source->AddLocalizedString("searchResults", IDS_HISTORY_SEARCH_RESULTS); |
| 81 source->AddLocalizedString("signInButton", IDS_MD_HISTORY_SIGN_IN_BUTTON); | 82 source->AddLocalizedString("signInButton", IDS_MD_HISTORY_SIGN_IN_BUTTON); |
| 82 source->AddLocalizedString("signInPromo", IDS_MD_HISTORY_SIGN_IN_PROMO); | 83 source->AddLocalizedString("signInPromo", IDS_MD_HISTORY_SIGN_IN_PROMO); |
| 83 source->AddLocalizedString("signInPromoDesc", | 84 source->AddLocalizedString("signInPromoDesc", |
| 84 IDS_MD_HISTORY_SIGN_IN_PROMO_DESC); | 85 IDS_MD_HISTORY_SIGN_IN_PROMO_DESC); |
| 85 source->AddLocalizedString("title", IDS_HISTORY_TITLE); | 86 source->AddLocalizedString("title", IDS_HISTORY_TITLE); |
| 86 | 87 |
| 87 source->AddString("deleteWarning", | |
| 88 HistoryUI::GetDeleteWarningString(profile)); | |
| 89 source->AddString( | 88 source->AddString( |
| 90 "sidebarFooter", | 89 "sidebarFooter", |
| 91 l10n_util::GetStringFUTF16( | 90 l10n_util::GetStringFUTF16( |
| 92 IDS_HISTORY_OTHER_FORMS_OF_HISTORY, | 91 IDS_HISTORY_OTHER_FORMS_OF_HISTORY, |
| 93 l10n_util::GetStringUTF16( | 92 l10n_util::GetStringUTF16( |
| 94 IDS_SETTINGS_CLEAR_DATA_WEB_HISTORY_URL_IN_HISTORY))); | 93 IDS_SETTINGS_CLEAR_DATA_WEB_HISTORY_URL_IN_HISTORY))); |
| 95 | 94 |
| 96 bool allow_deleting_history = | 95 bool allow_deleting_history = |
| 97 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); | 96 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| 98 source->AddBoolean("allowDeletingHistory", allow_deleting_history); | 97 source->AddBoolean("allowDeletingHistory", allow_deleting_history); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 base::FeatureList::ClearInstanceForTesting(); | 198 base::FeatureList::ClearInstanceForTesting(); |
| 200 base::FeatureList::SetInstance(std::move(feature_list)); | 199 base::FeatureList::SetInstance(std::move(feature_list)); |
| 201 } | 200 } |
| 202 | 201 |
| 203 // static | 202 // static |
| 204 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( | 203 base::RefCountedMemory* MdHistoryUI::GetFaviconResourceBytes( |
| 205 ui::ScaleFactor scale_factor) { | 204 ui::ScaleFactor scale_factor) { |
| 206 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( | 205 return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale( |
| 207 IDR_HISTORY_FAVICON, scale_factor); | 206 IDR_HISTORY_FAVICON, scale_factor); |
| 208 } | 207 } |
| OLD | NEW |