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 base::StartsWithASCII(action->api_name(), kDomXhrPrefix, true) && | 524 base::StartsWith(action->api_name(), kDomXhrPrefix, |
| 525 base::CompareCase::SENSITIVE) && |
525 action->other()) { | 526 action->other()) { |
526 base::DictionaryValue* other = action->mutable_other(); | 527 base::DictionaryValue* other = action->mutable_other(); |
527 int dom_verb = -1; | 528 int dom_verb = -1; |
528 if (other->GetInteger(constants::kActionDomVerb, &dom_verb) && | 529 if (other->GetInteger(constants::kActionDomVerb, &dom_verb) && |
529 dom_verb == DomActionType::METHOD) { | 530 dom_verb == DomActionType::METHOD) { |
530 other->SetInteger(constants::kActionDomVerb, DomActionType::XHR); | 531 other->SetInteger(constants::kActionDomVerb, DomActionType::XHR); |
531 } | 532 } |
532 } | 533 } |
533 | 534 |
534 if (uma_policy_) | 535 if (uma_policy_) |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 database_policy_->DeleteDatabase(); | 666 database_policy_->DeleteDatabase(); |
666 } | 667 } |
667 | 668 |
668 template <> | 669 template <> |
669 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { | 670 void BrowserContextKeyedAPIFactory<ActivityLog>::DeclareFactoryDependencies() { |
670 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 671 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
671 DependsOn(ExtensionRegistryFactory::GetInstance()); | 672 DependsOn(ExtensionRegistryFactory::GetInstance()); |
672 } | 673 } |
673 | 674 |
674 } // namespace extensions | 675 } // namespace extensions |
OLD | NEW |