Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: chrome/browser/ui/webui/history_ui.cc

Issue 919843003: Clear app banner data when history is cleared. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/history_ui.h" 5 #include "chrome/browser/ui/webui/history_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/i18n/rtl.h" 12 #include "base/i18n/rtl.h"
13 #include "base/i18n/time_formatting.h" 13 #include "base/i18n/time_formatting.h"
14 #include "base/memory/singleton.h" 14 #include "base/memory/singleton.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
18 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
19 #include "base/strings/string_number_conversions.h" 19 #include "base/strings/string_number_conversions.h"
20 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "base/values.h" 22 #include "base/values.h"
23 #include "chrome/browser/banners/app_banner_settings_helper.h"
23 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 24 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
24 #include "chrome/browser/chrome_notification_types.h" 25 #include "chrome/browser/chrome_notification_types.h"
25 #include "chrome/browser/history/history_service.h" 26 #include "chrome/browser/history/history_service.h"
26 #include "chrome/browser/history/history_service_factory.h" 27 #include "chrome/browser/history/history_service_factory.h"
27 #include "chrome/browser/history/web_history_service.h" 28 #include "chrome/browser/history/web_history_service.h"
28 #include "chrome/browser/history/web_history_service_factory.h" 29 #include "chrome/browser/history/web_history_service_factory.h"
29 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
30 #include "chrome/browser/signin/signin_manager_factory.h" 31 #include "chrome/browser/signin/signin_manager_factory.h"
31 #include "chrome/browser/sync/profile_sync_service.h" 32 #include "chrome/browser/sync/profile_sync_service.h"
32 #include "chrome/browser/sync/profile_sync_service_factory.h" 33 #include "chrome/browser/sync/profile_sync_service_factory.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 // the extension activity log. The extension activity log contains URLS 664 // the extension activity log. The extension activity log contains URLS
664 // which websites an extension has activity on so it will indirectly 665 // which websites an extension has activity on so it will indirectly
665 // contain websites that a user has visited. 666 // contain websites that a user has visited.
666 extensions::ActivityLog* activity_log = 667 extensions::ActivityLog* activity_log =
667 extensions::ActivityLog::GetInstance(profile); 668 extensions::ActivityLog::GetInstance(profile);
668 for (std::vector<history::ExpireHistoryArgs>::const_iterator it = 669 for (std::vector<history::ExpireHistoryArgs>::const_iterator it =
669 expire_list.begin(); it != expire_list.end(); ++it) { 670 expire_list.begin(); it != expire_list.end(); ++it) {
670 activity_log->RemoveURLs(it->urls); 671 activity_log->RemoveURLs(it->urls);
671 } 672 }
672 #endif 673 #endif
674
675 for (const history::ExpireHistoryArgs& expire_entry : expire_list)
676 AppBannerSettingsHelper::ClearHistoryForURLs(profile, expire_entry.urls);
673 } 677 }
674 678
675 void BrowsingHistoryHandler::HandleClearBrowsingData( 679 void BrowsingHistoryHandler::HandleClearBrowsingData(
676 const base::ListValue* args) { 680 const base::ListValue* args) {
677 #if defined(OS_ANDROID) 681 #if defined(OS_ANDROID)
678 chrome::android::ChromiumApplication::OpenClearBrowsingData( 682 chrome::android::ChromiumApplication::OpenClearBrowsingData(
679 web_ui()->GetWebContents()); 683 web_ui()->GetWebContents());
680 #else 684 #else
681 // TODO(beng): This is an improper direct dependency on Browser. Route this 685 // TODO(beng): This is an improper direct dependency on Browser. Route this
682 // through some sort of delegate. 686 // through some sort of delegate.
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 Profile* profile = Profile::FromWebUI(web_ui); 1035 Profile* profile = Profile::FromWebUI(web_ui);
1032 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile)); 1036 content::WebUIDataSource::Add(profile, CreateHistoryUIHTMLSource(profile));
1033 } 1037 }
1034 1038
1035 // static 1039 // static
1036 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes( 1040 base::RefCountedMemory* HistoryUI::GetFaviconResourceBytes(
1037 ui::ScaleFactor scale_factor) { 1041 ui::ScaleFactor scale_factor) {
1038 return ResourceBundle::GetSharedInstance(). 1042 return ResourceBundle::GetSharedInstance().
1039 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor); 1043 LoadDataResourceBytesForScale(IDR_HISTORY_FAVICON, scale_factor);
1040 } 1044 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data/browsing_data_remover.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698