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

Unified Diff: chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h

Issue 2716333002: Implement important sites dialog for desktop. (Closed)
Patch Set: change element.$.someId to element.$$(#someId) Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
diff --git a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
index 6137c84bcd618fa5c0df63b042b03def58b2e737..1002610b3c23e69e4e672320f4a18f8b6b3dfe6c 100644
--- a/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
+++ b/chrome/browser/ui/webui/settings/settings_clear_browsing_data_handler.h
@@ -21,6 +21,7 @@ class ListValue;
}
namespace content {
+class BrowsingDataFilterBuilder;
class WebUI;
}
@@ -39,17 +40,21 @@ class ClearBrowsingDataHandler : public SettingsPageUIHandler,
void OnJavascriptDisallowed() override;
private:
- // Observes one |remover| task initiated from ClearBrowsingDataHandler.
- // Calls |callback| when the task is finished.
- class TaskObserver;
-
// Clears browsing data, called by Javascript.
void HandleClearBrowsingData(const base::ListValue* value);
+ // Parses a ListValue with important site information and creates a
+ // BrowsingDataFilterBuilder.
+ std::unique_ptr<content::BrowsingDataFilterBuilder> ProcessImportantSites(
+ const base::ListValue* important_sites);
+
// Called when a clearing task finished. |webui_callback_id| is provided
// by the WebUI action that initiated it.
void OnClearingTaskFinished(const std::string& webui_callback_id);
+ // Get important sites, called by Javascript.
+ void HandleGetImportantSites(const base::ListValue* value);
+
// Initializes the dialog UI. Called by JavaScript when the DOM is ready.
void HandleInitialize(const base::ListValue* args);
@@ -85,9 +90,6 @@ class ClearBrowsingDataHandler : public SettingsPageUIHandler,
// Counters that calculate the data volume for individual data types.
std::vector<std::unique_ptr<browsing_data::BrowsingDataCounter>> counters_;
- // Observes the currently active data clearing task.
- std::unique_ptr<TaskObserver> task_observer_;
-
// ProfileSyncService to observe sync state changes.
browser_sync::ProfileSyncService* sync_service_;
ScopedObserver<browser_sync::ProfileSyncService, syncer::SyncServiceObserver>
@@ -103,6 +105,8 @@ class ClearBrowsingDataHandler : public SettingsPageUIHandler,
bool show_history_deletion_dialog_;
// A weak pointer factory for asynchronous calls referencing this class.
+ // The weak pointers are invalidated in |OnJavascriptDisallowed()| and
+ // |HandleInitialize()| to cancel previously initiated tasks.
base::WeakPtrFactory<ClearBrowsingDataHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(ClearBrowsingDataHandler);

Powered by Google App Engine
This is Rietveld 408576698