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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 128 |
| 129 PrefService* prefs = profile->GetPrefs(); | 129 PrefService* prefs = profile->GetPrefs(); |
| 130 bool allow_deleting_history = | 130 bool allow_deleting_history = |
| 131 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); | 131 prefs->GetBoolean(prefs::kAllowDeletingBrowserHistory); |
| 132 source->AddBoolean("allowDeletingHistory", allow_deleting_history); | 132 source->AddBoolean("allowDeletingHistory", allow_deleting_history); |
| 133 | 133 |
| 134 source->AddBoolean(kShowMenuPromoKey, !MenuPromoShown(profile)); | 134 source->AddBoolean(kShowMenuPromoKey, !MenuPromoShown(profile)); |
| 135 | 135 |
| 136 bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch( | 136 bool group_by_domain = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 137 switches::kHistoryEnableGroupByDomain) || profile->IsSupervised(); | 137 switches::kHistoryEnableGroupByDomain) || profile->IsSupervised(); |
| 138 source->AddBoolean("groupByDomain", group_by_domain); | 138 source->AddBoolean("groupByDomain", group_by_domain); |
|
calamity
2017/02/09 02:45:08
Nuke this.
tsergeant
2017/02/09 03:13:41
Done.
| |
| 139 | 139 |
| 140 source->AddBoolean("isGuestSession", profile->IsGuestSession()); | 140 source->AddBoolean("isGuestSession", profile->IsGuestSession()); |
| 141 | 141 |
| 142 source->AddBoolean(kIsUserSignedInKey, IsUserSignedIn(profile)); | 142 source->AddBoolean(kIsUserSignedInKey, IsUserSignedIn(profile)); |
| 143 | 143 |
| 144 struct UncompressedResource { | 144 struct UncompressedResource { |
| 145 const char* path; | 145 const char* path; |
| 146 int idr; | 146 int idr; |
| 147 }; | 147 }; |
| 148 const UncompressedResource uncompressed_resources[] = { | 148 const UncompressedResource uncompressed_resources[] = { |
| 149 {"constants.html", IDR_MD_HISTORY_CONSTANTS_HTML}, | 149 {"constants.html", IDR_MD_HISTORY_CONSTANTS_HTML}, |
| 150 {"constants.js", IDR_MD_HISTORY_CONSTANTS_JS}, | 150 {"constants.js", IDR_MD_HISTORY_CONSTANTS_JS}, |
| 151 {"history.js", IDR_MD_HISTORY_HISTORY_JS}, | 151 {"history.js", IDR_MD_HISTORY_HISTORY_JS}, |
| 152 {"images/100/sign_in_promo.jpg", | 152 {"images/100/sign_in_promo.jpg", |
| 153 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_JPG}, | 153 IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_JPG}, |
| 154 {"images/200/sign_in_promo.jpg", | 154 {"images/200/sign_in_promo.jpg", |
| 155 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_JPG}, | 155 IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_JPG}, |
| 156 #if !BUILDFLAG(USE_VULCANIZE) | 156 #if !BUILDFLAG(USE_VULCANIZE) |
| 157 {"app.html", IDR_MD_HISTORY_APP_HTML}, | 157 {"app.html", IDR_MD_HISTORY_APP_HTML}, |
| 158 {"app.js", IDR_MD_HISTORY_APP_JS}, | 158 {"app.js", IDR_MD_HISTORY_APP_JS}, |
| 159 {"browser_service.html", IDR_MD_HISTORY_BROWSER_SERVICE_HTML}, | 159 {"browser_service.html", IDR_MD_HISTORY_BROWSER_SERVICE_HTML}, |
| 160 {"browser_service.js", IDR_MD_HISTORY_BROWSER_SERVICE_JS}, | 160 {"browser_service.js", IDR_MD_HISTORY_BROWSER_SERVICE_JS}, |
| 161 {"grouped_list.html", IDR_MD_HISTORY_GROUPED_LIST_HTML}, | |
| 162 {"grouped_list.js", IDR_MD_HISTORY_GROUPED_LIST_JS}, | |
| 163 {"history_item.html", IDR_MD_HISTORY_HISTORY_ITEM_HTML}, | 161 {"history_item.html", IDR_MD_HISTORY_HISTORY_ITEM_HTML}, |
| 164 {"history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS}, | 162 {"history_item.js", IDR_MD_HISTORY_HISTORY_ITEM_JS}, |
| 165 {"history_list.html", IDR_MD_HISTORY_HISTORY_LIST_HTML}, | 163 {"history_list.html", IDR_MD_HISTORY_HISTORY_LIST_HTML}, |
| 166 {"history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS}, | 164 {"history_list.js", IDR_MD_HISTORY_HISTORY_LIST_JS}, |
| 167 {"history_list_behavior.html", IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML}, | 165 {"history_list_behavior.html", IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_HTML}, |
| 168 {"history_list_behavior.js", IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS}, | 166 {"history_list_behavior.js", IDR_MD_HISTORY_HISTORY_LIST_BEHAVIOR_JS}, |
| 169 {"history_toolbar.html", IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML}, | 167 {"history_toolbar.html", IDR_MD_HISTORY_HISTORY_TOOLBAR_HTML}, |
| 170 {"history_toolbar.js", IDR_MD_HISTORY_HISTORY_TOOLBAR_JS}, | 168 {"history_toolbar.js", IDR_MD_HISTORY_HISTORY_TOOLBAR_JS}, |
| 171 {"icons.html", IDR_MD_HISTORY_ICONS_HTML}, | 169 {"icons.html", IDR_MD_HISTORY_ICONS_HTML}, |
| 172 {"lazy_load.html", IDR_MD_HISTORY_LAZY_LOAD_HTML}, | 170 {"lazy_load.html", IDR_MD_HISTORY_LAZY_LOAD_HTML}, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 | 268 |
| 271 content::WebUIDataSource::Update(profile, chrome::kChromeUIHistoryHost, | 269 content::WebUIDataSource::Update(profile, chrome::kChromeUIHistoryHost, |
| 272 std::move(update)); | 270 std::move(update)); |
| 273 } | 271 } |
| 274 | 272 |
| 275 void MdHistoryUI::HandleMenuPromoShown(const base::ListValue* args) { | 273 void MdHistoryUI::HandleMenuPromoShown(const base::ListValue* args) { |
| 276 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( | 274 Profile::FromWebUI(web_ui())->GetPrefs()->SetBoolean( |
| 277 prefs::kMdHistoryMenuPromoShown, true); | 275 prefs::kMdHistoryMenuPromoShown, true); |
| 278 UpdateDataSource(); | 276 UpdateDataSource(); |
| 279 } | 277 } |
| OLD | NEW |