| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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/extensions/activity_log/counting_policy.h" | 5 #include "chrome/browser/extensions/activity_log/counting_policy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 .Build()) | 578 .Build()) |
| 579 .Build(); | 579 .Build(); |
| 580 extension_service_->AddExtension(extension.get()); | 580 extension_service_->AddExtension(extension.get()); |
| 581 GURL gurl("http://www.google.com"); | 581 GURL gurl("http://www.google.com"); |
| 582 | 582 |
| 583 // Write some API calls | 583 // Write some API calls |
| 584 scoped_refptr<Action> action_api = new Action(extension->id(), | 584 scoped_refptr<Action> action_api = new Action(extension->id(), |
| 585 base::Time::Now(), | 585 base::Time::Now(), |
| 586 Action::ACTION_API_CALL, | 586 Action::ACTION_API_CALL, |
| 587 "tabs.testMethod"); | 587 "tabs.testMethod"); |
| 588 action_api->set_args(base::WrapUnique(new base::ListValue())); | 588 action_api->set_args(base::MakeUnique<base::ListValue>()); |
| 589 policy->ProcessAction(action_api); | 589 policy->ProcessAction(action_api); |
| 590 | 590 |
| 591 scoped_refptr<Action> action_dom = new Action(extension->id(), | 591 scoped_refptr<Action> action_dom = new Action(extension->id(), |
| 592 base::Time::Now(), | 592 base::Time::Now(), |
| 593 Action::ACTION_DOM_ACCESS, | 593 Action::ACTION_DOM_ACCESS, |
| 594 "document.write"); | 594 "document.write"); |
| 595 action_dom->set_args(base::WrapUnique(new base::ListValue())); | 595 action_dom->set_args(base::MakeUnique<base::ListValue>()); |
| 596 action_dom->set_page_url(gurl); | 596 action_dom->set_page_url(gurl); |
| 597 policy->ProcessAction(action_dom); | 597 policy->ProcessAction(action_dom); |
| 598 | 598 |
| 599 CheckReadFilteredData( | 599 CheckReadFilteredData( |
| 600 policy, | 600 policy, |
| 601 extension->id(), | 601 extension->id(), |
| 602 Action::ACTION_API_CALL, | 602 Action::ACTION_API_CALL, |
| 603 "tabs.testMethod", | 603 "tabs.testMethod", |
| 604 "", | 604 "", |
| 605 "", | 605 "", |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 | 1279 |
| 1280 action_ids.push_back(2); | 1280 action_ids.push_back(2); |
| 1281 CheckRemoveActions( | 1281 CheckRemoveActions( |
| 1282 policy, action_ids, base::Bind(&CountingPolicyTest::Action2Deleted)); | 1282 policy, action_ids, base::Bind(&CountingPolicyTest::Action2Deleted)); |
| 1283 action_ids.clear(); | 1283 action_ids.clear(); |
| 1284 | 1284 |
| 1285 policy->Close(); | 1285 policy->Close(); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 } // namespace extensions | 1288 } // namespace extensions |
| OLD | NEW |