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

Unified Diff: chrome/browser/prefs/interceptable_pref_filter.h

Issue 620933002: Move all files related to tracked preferences from c/b/prefs to c/b/prefs/tracked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/prefs/interceptable_pref_filter.h
diff --git a/chrome/browser/prefs/interceptable_pref_filter.h b/chrome/browser/prefs/interceptable_pref_filter.h
deleted file mode 100644
index a1ba00df23d00a625754f7d1e900cfaefc83eee7..0000000000000000000000000000000000000000
--- a/chrome/browser/prefs/interceptable_pref_filter.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_PREFS_INTERCEPTABLE_PREF_FILTER_H_
-#define CHROME_BROWSER_PREFS_INTERCEPTABLE_PREF_FILTER_H_
-
-#include "base/callback.h"
-#include "base/memory/weak_ptr.h"
-#include "base/prefs/pref_filter.h"
-#include "base/values.h"
-
-// A partial implementation of a PrefFilter whose FilterOnLoad call may be
-// intercepted by a FilterOnLoadInterceptor. Implementations of
-// InterceptablePrefFilter are expected to override FinalizeFilterOnLoad rather
-// than re-overriding FilterOnLoad.
-class InterceptablePrefFilter
- : public PrefFilter,
- public base::SupportsWeakPtr<InterceptablePrefFilter> {
- public:
- // A callback to be invoked by a FilterOnLoadInterceptor when its ready to
- // hand back the |prefs| it was handed for early filtering. |prefs_altered|
- // indicates whether the |prefs| were actually altered by the
- // FilterOnLoadInterceptor before being handed back.
- typedef base::Callback<void(scoped_ptr<base::DictionaryValue> prefs,
- bool prefs_altered)> FinalizeFilterOnLoadCallback;
-
- // A callback to be invoked from FilterOnLoad. It takes ownership of prefs
- // and may modify them before handing them back to this
- // InterceptablePrefFilter via |finalize_filter_on_load|.
- typedef base::Callback<
- void(const FinalizeFilterOnLoadCallback& finalize_filter_on_load,
- scoped_ptr<base::DictionaryValue> prefs)> FilterOnLoadInterceptor;
-
- InterceptablePrefFilter();
- virtual ~InterceptablePrefFilter();
-
- // PrefFilter partial implementation.
- virtual void FilterOnLoad(
- const PostFilterOnLoadCallback& post_filter_on_load_callback,
- scoped_ptr<base::DictionaryValue> pref_store_contents) OVERRIDE;
-
- // Registers |filter_on_load_interceptor| to intercept the next FilterOnLoad
- // event. At most one FilterOnLoadInterceptor should be registered per
- // PrefFilter.
- void InterceptNextFilterOnLoad(
- const FilterOnLoadInterceptor& filter_on_load_interceptor);
-
- private:
- // Does any extra filtering required by the implementation of this
- // InterceptablePrefFilter and hands back the |pref_store_contents| to the
- // initial caller of FilterOnLoad.
- virtual void FinalizeFilterOnLoad(
- const PostFilterOnLoadCallback& post_filter_on_load_callback,
- scoped_ptr<base::DictionaryValue> pref_store_contents,
- bool prefs_altered) = 0;
-
- // Callback to be invoked only once (and subsequently reset) on the next
- // FilterOnLoad event. It will be allowed to modify the |prefs| handed to
- // FilterOnLoad before handing them back to this PrefHashFilter.
- FilterOnLoadInterceptor filter_on_load_interceptor_;
-};
-
-#endif // CHROME_BROWSER_PREFS_INTERCEPTABLE_PREF_FILTER_H_
« no previous file with comments | « chrome/browser/prefs/chrome_pref_service_factory.cc ('k') | chrome/browser/prefs/interceptable_pref_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698