OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "base/json/json_string_value_serializer.h" | |
6 #include "chrome/browser/extensions/activity_log/stream_noargs_ui_policy.h" | |
7 | |
8 namespace extensions { | |
9 | |
10 StreamWithoutArgsUIPolicy::StreamWithoutArgsUIPolicy( | |
11 Profile* profile, | |
12 content::BrowserThread::ID thread_id) | |
13 : FullStreamUIPolicy(profile, thread_id) { | |
14 for (int i = 0; i < APIAction::kSizeAlwaysLog; i++) { | |
15 arg_whitelist_api_.insert(APIAction::kAlwaysLog[i]); | |
16 } | |
17 } | |
18 | |
19 StreamWithoutArgsUIPolicy::~StreamWithoutArgsUIPolicy() {} | |
20 | |
21 void StreamWithoutArgsUIPolicy::ProcessArguments( | |
22 ActionType action_type, | |
23 const std::string& name, | |
24 const base::ListValue* args, | |
25 std::string* args_string) const { | |
26 if (action_type == ACTION_DOM || | |
27 arg_whitelist_api_.find(name) != arg_whitelist_api_.end()) { | |
28 FullStreamUIPolicy::ProcessArguments(action_type, name, args, args_string); | |
29 } else { | |
30 return; | |
Matt Perry
2013/06/13 18:23:23
else branch is unnecessary
dbabic
2013/06/13 23:10:08
Done.
| |
31 } | |
32 } | |
33 | |
34 void StreamWithoutArgsUIPolicy::ProcessWebRequestModifications( | |
35 base::DictionaryValue& details, | |
36 std::string& details_string) const { | |
37 // Strip details of the web request modifications (for privacy reasons). | |
38 DictionaryValue::Iterator details_iterator(details); | |
39 while (!details_iterator.IsAtEnd()) { | |
40 details.SetBoolean(details_iterator.key(), true); | |
41 details_iterator.Advance(); | |
42 } | |
43 JSONStringValueSerializer serializer(&details_string); | |
44 serializer.SerializeAndOmitBinaryValues(details); | |
45 } | |
46 | |
47 } // namespace extensions | |
OLD | NEW |