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 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 break; | 600 break; |
601 case content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED: { | 601 case content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED: { |
602 content::RenderWidgetHost* rwh = | 602 content::RenderWidgetHost* rwh = |
603 content::Source<content::RenderWidgetHost>(source).ptr(); | 603 content::Source<content::RenderWidgetHost>(source).ptr(); |
604 deleting_rwh_id_ = rwh->GetRoutingID(); | 604 deleting_rwh_id_ = rwh->GetRoutingID(); |
605 deleting_rph_id_ = rwh->GetProcess()->GetID(); | 605 deleting_rph_id_ = rwh->GetProcess()->GetID(); |
606 MaybeUpdateAfterNotification(); | 606 MaybeUpdateAfterNotification(); |
607 break; | 607 break; |
608 } | 608 } |
609 case chrome::NOTIFICATION_EXTENSION_LOADED: | 609 case chrome::NOTIFICATION_EXTENSION_LOADED: |
610 case chrome::NOTIFICATION_EXTENSION_UNLOADED: | 610 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: |
611 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 611 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
612 case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: | 612 case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: |
613 case chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED: | 613 case chrome::NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED: |
614 MaybeUpdateAfterNotification(); | 614 MaybeUpdateAfterNotification(); |
615 break; | 615 break; |
616 case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: | 616 case chrome::NOTIFICATION_EXTENSION_HOST_DESTROYED: |
617 // This notification is sent when the extension host destruction begins, | 617 // This notification is sent when the extension host destruction begins, |
618 // not when it finishes. We use PostTask to delay the update until after | 618 // not when it finishes. We use PostTask to delay the update until after |
619 // the destruction finishes. | 619 // the destruction finishes. |
620 base::MessageLoop::current()->PostTask( | 620 base::MessageLoop::current()->PostTask( |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1060 void ExtensionSettingsHandler::MaybeRegisterForNotifications() { | 1060 void ExtensionSettingsHandler::MaybeRegisterForNotifications() { |
1061 if (registered_for_notifications_) | 1061 if (registered_for_notifications_) |
1062 return; | 1062 return; |
1063 | 1063 |
1064 registered_for_notifications_ = true; | 1064 registered_for_notifications_ = true; |
1065 Profile* profile = Profile::FromWebUI(web_ui()); | 1065 Profile* profile = Profile::FromWebUI(web_ui()); |
1066 | 1066 |
1067 // Register for notifications that we need to reload the page. | 1067 // Register for notifications that we need to reload the page. |
1068 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 1068 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
1069 content::Source<Profile>(profile)); | 1069 content::Source<Profile>(profile)); |
1070 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 1070 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
1071 content::Source<Profile>(profile)); | 1071 content::Source<Profile>(profile)); |
1072 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 1072 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
1073 content::Source<Profile>(profile)); | 1073 content::Source<Profile>(profile)); |
1074 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, | 1074 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED, |
1075 content::Source<Profile>(profile)); | 1075 content::Source<Profile>(profile)); |
1076 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 1076 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
1077 content::NotificationService::AllBrowserContextsAndSources()); | 1077 content::NotificationService::AllBrowserContextsAndSources()); |
1078 registrar_.Add(this, | 1078 registrar_.Add(this, |
1079 chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED, | 1079 chrome::NOTIFICATION_BACKGROUND_CONTENTS_NAVIGATED, |
1080 content::NotificationService::AllBrowserContextsAndSources()); | 1080 content::NotificationService::AllBrowserContextsAndSources()); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1248 extension_service_->EnableExtension(extension_id); | 1248 extension_service_->EnableExtension(extension_id); |
1249 } else { | 1249 } else { |
1250 ExtensionErrorReporter::GetInstance()->ReportError( | 1250 ExtensionErrorReporter::GetInstance()->ReportError( |
1251 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1251 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1252 true /* be noisy */); | 1252 true /* be noisy */); |
1253 } | 1253 } |
1254 requirements_checker_.reset(); | 1254 requirements_checker_.reset(); |
1255 } | 1255 } |
1256 | 1256 |
1257 } // namespace extensions | 1257 } // namespace extensions |
OLD | NEW |