| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/activity_log.h" | 5 #include "chrome/browser/extensions/activity_log/activity_log.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 void ActivityLog::LogAction(scoped_refptr<Action> action) { | 514 void ActivityLog::LogAction(scoped_refptr<Action> action) { |
| 515 if (ActivityLogAPI::IsExtensionWhitelisted(action->extension_id())) | 515 if (ActivityLogAPI::IsExtensionWhitelisted(action->extension_id())) |
| 516 return; | 516 return; |
| 517 | 517 |
| 518 // Perform some preprocessing of the Action data: convert tab IDs to URLs and | 518 // Perform some preprocessing of the Action data: convert tab IDs to URLs and |
| 519 // mask out incognito URLs if appropriate. | 519 // mask out incognito URLs if appropriate. |
| 520 ExtractUrls(action, profile_); | 520 ExtractUrls(action, profile_); |
| 521 | 521 |
| 522 // Mark DOM XHR requests as such, for easier processing later. | 522 // Mark DOM XHR requests as such, for easier processing later. |
| 523 if (action->action_type() == Action::ACTION_DOM_ACCESS && | 523 if (action->action_type() == Action::ACTION_DOM_ACCESS && |
| 524 StartsWithASCII(action->api_name(), kDomXhrPrefix, true) && | 524 base::StartsWithASCII(action->api_name(), kDomXhrPrefix, true) && |
| 525 action->other()) { | 525 action->other()) { |
| 526 base::DictionaryValue* other = action->mutable_other(); | 526 base::DictionaryValue* other = action->mutable_other(); |
| 527 int dom_verb = -1; | 527 int dom_verb = -1; |
| 528 if (other->GetInteger(constants::kActionDomVerb, &dom_verb) && | 528 if (other->GetInteger(constants::kActionDomVerb, &dom_verb) && |
| 529 dom_verb == DomActionType::METHOD) { | 529 dom_verb == DomActionType::METHOD) { |
| 530 other->SetInteger(constants::kActionDomVerb, DomActionType::XHR); | 530 other->SetInteger(constants::kActionDomVerb, DomActionType::XHR); |
| 531 } | 531 } |
| 532 } | 532 } |
| 533 | 533 |
| 534 if (uma_policy_) | 534 if (uma_policy_) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 665 database_policy_->DeleteDatabase(); | 665 database_policy_->DeleteDatabase(); |
| 666 } | 666 } |
| 667 | 667 |
| 668 template <> | 668 template <> |
| 669 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { | 669 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { |
| 670 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 670 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 671 DependsOn(ExtensionRegistryFactory::GetInstance()); | 671 DependsOn(ExtensionRegistryFactory::GetInstance()); |
| 672 } | 672 } |
| 673 | 673 |
| 674 } // namespace extensions | 674 } // namespace extensions |
| OLD | NEW |