OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/app_window.h" | 9 #include "apps/app_window.h" |
10 #include "apps/app_window_registry.h" | 10 #include "apps/app_window_registry.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 #include "chrome/browser/managed_mode/managed_user_service.h" | 45 #include "chrome/browser/managed_mode/managed_user_service.h" |
46 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 46 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
47 #include "chrome/browser/profiles/profile.h" | 47 #include "chrome/browser/profiles/profile.h" |
48 #include "chrome/browser/tab_contents/background_contents.h" | 48 #include "chrome/browser/tab_contents/background_contents.h" |
49 #include "chrome/browser/ui/browser_finder.h" | 49 #include "chrome/browser/ui/browser_finder.h" |
50 #include "chrome/browser/ui/chrome_select_file_policy.h" | 50 #include "chrome/browser/ui/chrome_select_file_policy.h" |
51 #include "chrome/browser/ui/extensions/application_launch.h" | 51 #include "chrome/browser/ui/extensions/application_launch.h" |
52 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" | 52 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h" |
53 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 53 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
54 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
55 #include "chrome/common/chrome_version_info.h" | |
55 #include "chrome/common/extensions/extension_constants.h" | 56 #include "chrome/common/extensions/extension_constants.h" |
56 #include "chrome/common/extensions/extension_icon_set.h" | 57 #include "chrome/common/extensions/extension_icon_set.h" |
57 #include "chrome/common/extensions/manifest_url_handler.h" | 58 #include "chrome/common/extensions/manifest_url_handler.h" |
58 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
59 #include "chrome/common/url_constants.h" | 60 #include "chrome/common/url_constants.h" |
60 #include "components/user_prefs/pref_registry_syncable.h" | 61 #include "components/user_prefs/pref_registry_syncable.h" |
61 #include "content/public/browser/notification_service.h" | 62 #include "content/public/browser/notification_service.h" |
62 #include "content/public/browser/notification_source.h" | 63 #include "content/public/browser/notification_source.h" |
63 #include "content/public/browser/notification_types.h" | 64 #include "content/public/browser/notification_types.h" |
64 #include "content/public/browser/render_process_host.h" | 65 #include "content/public/browser/render_process_host.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 if (!warnings.empty()) { | 328 if (!warnings.empty()) { |
328 base::ListValue* warnings_list = new base::ListValue; | 329 base::ListValue* warnings_list = new base::ListValue; |
329 for (std::vector<std::string>::const_iterator iter = warnings.begin(); | 330 for (std::vector<std::string>::const_iterator iter = warnings.begin(); |
330 iter != warnings.end(); ++iter) { | 331 iter != warnings.end(); ++iter) { |
331 warnings_list->Append(base::Value::CreateStringValue(*iter)); | 332 warnings_list->Append(base::Value::CreateStringValue(*iter)); |
332 } | 333 } |
333 extension_data->Set("warnings", warnings_list); | 334 extension_data->Set("warnings", warnings_list); |
334 } | 335 } |
335 } | 336 } |
336 | 337 |
337 // If the ErrorConsole is enabled, get the errors for the extension and add | 338 // We display errors from the ErrorConsole if either the switch is enabled or |
338 // them to the list. Otherwise, use the install warnings (using both is | 339 // we are in a development channel, and the error console itself is enabled |
339 // redundant). | 340 // (i.e., the user is in Developer Mode). |
340 ErrorConsole* error_console = | 341 ErrorConsole* error_console = |
341 ErrorConsole::Get(extension_service_->profile()); | 342 ErrorConsole::Get(extension_service_->profile()); |
342 if (error_console->enabled()) { | 343 if ((FeatureSwitch::error_console()->IsEnabled() || |
344 chrome::VersionInfo::GetChannel() <= chrome::VersionInfo::CHANNEL_DEV) && | |
345 error_console->enabled()) { | |
not at google - send to devlin
2014/03/27 23:41:11
It's a bit weird having the enabled checks only he
Devlin
2014/03/28 01:25:49
I don't know if we can pull it into ErrorConsole,
not at google - send to devlin
2014/03/28 15:07:40
Ok, thanks for the explanation. I still thing that
Devlin
2014/03/28 21:49:59
Done.
| |
343 const ErrorList& errors = | 346 const ErrorList& errors = |
344 error_console->GetErrorsForExtension(extension->id()); | 347 error_console->GetErrorsForExtension(extension->id()); |
345 if (!errors.empty()) { | 348 if (!errors.empty()) { |
346 scoped_ptr<base::ListValue> manifest_errors(new base::ListValue); | 349 scoped_ptr<base::ListValue> manifest_errors(new base::ListValue); |
347 scoped_ptr<base::ListValue> runtime_errors(new base::ListValue); | 350 scoped_ptr<base::ListValue> runtime_errors(new base::ListValue); |
348 for (ErrorList::const_iterator iter = errors.begin(); | 351 for (ErrorList::const_iterator iter = errors.begin(); |
349 iter != errors.end(); ++iter) { | 352 iter != errors.end(); ++iter) { |
350 if ((*iter)->type() == ExtensionError::MANIFEST_ERROR) { | 353 if ((*iter)->type() == ExtensionError::MANIFEST_ERROR) { |
351 manifest_errors->Append((*iter)->ToValue().release()); | 354 manifest_errors->Append((*iter)->ToValue().release()); |
352 } else { // Handle runtime error. | 355 } else { // Handle runtime error. |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1329 const base::FilePath& path) { | 1332 const base::FilePath& path) { |
1330 if (IndexOfLoadingPath(path) == -1) | 1333 if (IndexOfLoadingPath(path) == -1) |
1331 return; // Not an extension we're tracking. | 1334 return; // Not an extension we're tracking. |
1332 if (retry) | 1335 if (retry) |
1333 LoadUnpackedExtension(path); | 1336 LoadUnpackedExtension(path); |
1334 else | 1337 else |
1335 RemoveLoadingPath(path); | 1338 RemoveLoadingPath(path); |
1336 } | 1339 } |
1337 | 1340 |
1338 } // namespace extensions | 1341 } // namespace extensions |
OLD | NEW |