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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 source_profile = content::Source<Profile>(source).ptr(); | 437 source_profile = content::Source<Profile>(source).ptr(); |
438 if (!profile->IsSameProfile(source_profile)) | 438 if (!profile->IsSameProfile(source_profile)) |
439 return; | 439 return; |
440 MaybeUpdateAfterNotification(); | 440 MaybeUpdateAfterNotification(); |
441 break; | 441 break; |
442 case chrome::NOTIFICATION_EXTENSION_LOADED: | 442 case chrome::NOTIFICATION_EXTENSION_LOADED: |
443 case chrome::NOTIFICATION_EXTENSION_UNLOADED: | 443 case chrome::NOTIFICATION_EXTENSION_UNLOADED: |
444 case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: | 444 case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: |
445 case chrome::NOTIFICATION_EXTENSION_WARNING_CHANGED: | 445 case chrome::NOTIFICATION_EXTENSION_WARNING_CHANGED: |
446 case chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED: | 446 case chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED: |
447 case chrome::NOTIFICATION_PREF_CHANGED: | |
448 MaybeUpdateAfterNotification(); | 447 MaybeUpdateAfterNotification(); |
449 break; | 448 break; |
450 default: | 449 default: |
451 NOTREACHED(); | 450 NOTREACHED(); |
452 } | 451 } |
453 } | 452 } |
454 | 453 |
| 454 void ExtensionSettingsHandler::OnPreferenceChanged( |
| 455 PrefServiceBase* service, |
| 456 const std::string& pref_name) { |
| 457 MaybeUpdateAfterNotification(); |
| 458 } |
| 459 |
455 void ExtensionSettingsHandler::ExtensionUninstallAccepted() { | 460 void ExtensionSettingsHandler::ExtensionUninstallAccepted() { |
456 DCHECK(!extension_id_prompting_.empty()); | 461 DCHECK(!extension_id_prompting_.empty()); |
457 | 462 |
458 bool was_terminated = false; | 463 bool was_terminated = false; |
459 | 464 |
460 // The extension can be uninstalled in another window while the UI was | 465 // The extension can be uninstalled in another window while the UI was |
461 // showing. Do nothing in that case. | 466 // showing. Do nothing in that case. |
462 const Extension* extension = | 467 const Extension* extension = |
463 extension_service_->GetExtensionById(extension_id_prompting_, true); | 468 extension_service_->GetExtensionById(extension_id_prompting_, true); |
464 if (!extension) { | 469 if (!extension) { |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 std::vector<std::string> requirement_errors) { | 959 std::vector<std::string> requirement_errors) { |
955 if (requirement_errors.empty()) { | 960 if (requirement_errors.empty()) { |
956 extension_service_->EnableExtension(extension_id); | 961 extension_service_->EnableExtension(extension_id); |
957 } else { | 962 } else { |
958 ExtensionErrorReporter::GetInstance()->ReportError( | 963 ExtensionErrorReporter::GetInstance()->ReportError( |
959 UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 964 UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
960 true /* be noisy */); | 965 true /* be noisy */); |
961 } | 966 } |
962 requirements_checker_.reset(); | 967 requirements_checker_.reset(); |
963 } | 968 } |
OLD | NEW |