| 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 <set> | 5 #include <set> |
| 6 #include <vector> | 6 #include <vector> |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 } | 183 } |
| 184 | 184 |
| 185 // We can't register for the InstallTrackerFactory events or talk to the | 185 // We can't register for the InstallTrackerFactory events or talk to the |
| 186 // extension service in the constructor, so we do that here the first time | 186 // extension service in the constructor, so we do that here the first time |
| 187 // this is called (as identified by first_time_checking_). | 187 // this is called (as identified by first_time_checking_). |
| 188 bool ActivityLog::IsLogEnabled() { | 188 bool ActivityLog::IsLogEnabled() { |
| 189 if (!first_time_checking_) return enabled_; | 189 if (!first_time_checking_) return enabled_; |
| 190 if (!has_threads_) return false; | 190 if (!has_threads_) return false; |
| 191 tracker_ = InstallTrackerFactory::GetForProfile(profile_); | 191 tracker_ = InstallTrackerFactory::GetForProfile(profile_); |
| 192 tracker_->AddObserver(this); | 192 tracker_->AddObserver(this); |
| 193 const ExtensionService* extension_service = | 193 // TODO(felt): Fix this. |
| 194 /*const ExtensionService* extension_service = |
| 194 ExtensionSystem::Get(profile_)->extension_service(); | 195 ExtensionSystem::Get(profile_)->extension_service(); |
| 195 if (extension_service->IsExtensionEnabled( | 196 if (extension_service->IsExtensionEnabled( |
| 196 kActivityLogExtensionId)) { | 197 kActivityLogExtensionId)) { |
| 197 enabled_ = true; | 198 enabled_ = true; |
| 198 LogIsEnabled::GetInstance()->SetProfileEnabled(true); | 199 LogIsEnabled::GetInstance()->SetProfileEnabled(true); |
| 199 } | 200 }*/ |
| 200 first_time_checking_ = false; | 201 first_time_checking_ = false; |
| 201 return enabled_; | 202 return enabled_; |
| 202 } | 203 } |
| 203 | 204 |
| 204 void ActivityLog::OnExtensionInstalled(const Extension* extension) { | 205 void ActivityLog::OnExtensionInstalled(const Extension* extension) { |
| 205 if (extension->id() != kActivityLogExtensionId) return; | 206 if (extension->id() != kActivityLogExtensionId) return; |
| 206 enabled_ = true; | 207 enabled_ = true; |
| 207 LogIsEnabled::GetInstance()->SetProfileEnabled(true); | 208 LogIsEnabled::GetInstance()->SetProfileEnabled(true); |
| 208 } | 209 } |
| 209 | 210 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 web_contents->GetTitle(), | 446 web_contents->GetTitle(), |
| 446 std::string(), // no api call here | 447 std::string(), // no api call here |
| 447 script_names.get(), | 448 script_names.get(), |
| 448 DomActionType::INSERTED, | 449 DomActionType::INSERTED, |
| 449 extra); | 450 extra); |
| 450 } | 451 } |
| 451 } | 452 } |
| 452 } | 453 } |
| 453 | 454 |
| 454 } // namespace extensions | 455 } // namespace extensions |
| OLD | NEW |