| 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/error_console/error_console.h" | 5 #include "chrome/browser/extensions/error_console/error_console.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 } | 165 } |
| 166 | 166 |
| 167 void ErrorConsole::RemoveObserver(Observer* observer) { | 167 void ErrorConsole::RemoveObserver(Observer* observer) { |
| 168 DCHECK(thread_checker_.CalledOnValidThread()); | 168 DCHECK(thread_checker_.CalledOnValidThread()); |
| 169 observers_.RemoveObserver(observer); | 169 observers_.RemoveObserver(observer); |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool ErrorConsole::IsEnabledForChromeExtensionsPage() const { | 172 bool ErrorConsole::IsEnabledForChromeExtensionsPage() const { |
| 173 if (!profile_->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)) | 173 if (!profile_->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode)) |
| 174 return false; // Only enabled in developer mode. | 174 return false; // Only enabled in developer mode. |
| 175 if (GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV && | 175 if (GetCurrentChannel() > version_info::Channel::DEV && |
| 176 !FeatureSwitch::error_console()->IsEnabled()) | 176 !FeatureSwitch::error_console()->IsEnabled()) |
| 177 return false; // Restricted to dev channel or opt-in. | 177 return false; // Restricted to dev channel or opt-in. |
| 178 | 178 |
| 179 return true; | 179 return true; |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool ErrorConsole::IsEnabledForAppsDeveloperTools() const { | 182 bool ErrorConsole::IsEnabledForAppsDeveloperTools() const { |
| 183 return ExtensionRegistry::Get(profile_)->enabled_extensions() | 183 return ExtensionRegistry::Get(profile_)->enabled_extensions() |
| 184 .Contains(kAppsDeveloperToolsExtensionId); | 184 .Contains(kAppsDeveloperToolsExtensionId); |
| 185 } | 185 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 ExtensionRegistry::Get(profile_)->GetExtensionById( | 292 ExtensionRegistry::Get(profile_)->GetExtensionById( |
| 293 extension_id, ExtensionRegistry::EVERYTHING); | 293 extension_id, ExtensionRegistry::EVERYTHING); |
| 294 if (extension && extension->location() == Manifest::UNPACKED) | 294 if (extension && extension->location() == Manifest::UNPACKED) |
| 295 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; | 295 return (1 << ExtensionError::NUM_ERROR_TYPES) - 1; |
| 296 | 296 |
| 297 // Otherwise, use the default mask. | 297 // Otherwise, use the default mask. |
| 298 return default_mask_; | 298 return default_mask_; |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace extensions | 301 } // namespace extensions |
| OLD | NEW |