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

Unified Diff: chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc

Issue 15573003: New architecture of the activity logging: Policies for summarization (and compression) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser test. Created 7 years, 6 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/extensions/activity_log/stream_noargs_ui_policy.cc
diff --git a/chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc b/chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c30d33dd414c6f8d3604fed41507ab6094c24c18
--- /dev/null
+++ b/chrome/browser/extensions/activity_log/stream_noargs_ui_policy.cc
@@ -0,0 +1,44 @@
+// Copyright 2013 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.
+
+#include "base/json/json_string_value_serializer.h"
+#include "chrome/browser/extensions/activity_log/stream_noargs_ui_policy.h"
+
+namespace extensions {
+
+StreamWithoutArgsUIPolicy::StreamWithoutArgsUIPolicy(Profile* profile)
+ : FullStreamUIPolicy(profile) {
+ for (int i = 0; i < APIAction::kSizeAlwaysLog; i++) {
+ arg_whitelist_api_.insert(APIAction::kAlwaysLog[i]);
+ }
+}
+
+StreamWithoutArgsUIPolicy::~StreamWithoutArgsUIPolicy() {}
+
+std::string StreamWithoutArgsUIPolicy::ProcessArguments(
+ ActionType action_type,
+ const std::string& name,
+ const base::ListValue* args) const {
+ if (action_type == ACTION_DOM ||
+ arg_whitelist_api_.find(name) != arg_whitelist_api_.end()) {
+ return FullStreamUIPolicy::ProcessArguments(action_type, name, args);
+ } else {
+ return std::string();
+ }
+}
+
+void StreamWithoutArgsUIPolicy::ProcessWebRequestModifications(
+ base::DictionaryValue& details,
+ std::string& details_string) const {
+ // Strip details of the web request modifications (for privacy reasons).
+ DictionaryValue::Iterator details_iterator(details);
+ while (!details_iterator.IsAtEnd()) {
+ details.SetBoolean(details_iterator.key(), true);
+ details_iterator.Advance();
+ }
+ JSONStringValueSerializer serializer(&details_string);
+ serializer.SerializeAndOmitBinaryValues(details);
+}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698