Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2968)

Unified Diff: chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc

Issue 166273014: Remove dependency on NotificationService for cros a11y settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge ToT. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
index 8db3e8b3e706ae219bbdfed47bfa64bdcdf446c6..8c943c1f0bea5c8326db5005b10975e8b9da6a18 100644
--- a/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc
@@ -8,7 +8,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/login/wizard_controller.h"
@@ -21,7 +20,6 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_version_info.h"
#include "chromeos/chromeos_constants.h"
-#include "content/public/browser/notification_service.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -51,26 +49,11 @@ CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui)
show_oobe_ui_(false),
version_info_updater_(this),
delegate_(NULL) {
- registrar_.Add(
- this,
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE,
- content::NotificationService::AllSources());
- registrar_.Add(
- this,
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER,
- content::NotificationService::AllSources());
- registrar_.Add(
- this,
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK,
- content::NotificationService::AllSources());
- registrar_.Add(
- this,
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_LARGE_CURSOR,
- content::NotificationService::AllSources());
- registrar_.Add(
- this,
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_VIRTUAL_KEYBOARD,
- content::NotificationService::AllSources());
+ AccessibilityManager* accessibility_manager = AccessibilityManager::Get();
+ CHECK(accessibility_manager);
+ accessibility_subscription_ = accessibility_manager->RegisterCallback(
+ base::Bind(&CoreOobeHandler::OnAccessibilityStatusChanged,
+ base::Unretained(this)));
}
CoreOobeHandler::~CoreOobeHandler() {
@@ -326,20 +309,12 @@ void CoreOobeHandler::UpdateDeviceRequisition() {
connector->GetDeviceCloudPolicyManager()->GetDeviceRequisition());
}
-void CoreOobeHandler::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type ==
- chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE ||
- type == chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_LARGE_CURSOR ||
- type == chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER ||
- type == chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK ||
- type == chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_VIRTUAL_KEYBOARD)
- {
+void CoreOobeHandler::OnAccessibilityStatusChanged(
+ const AccessibilityStatusEventDetails& details) {
+ if (details.notification_type == ACCESSIBILITY_MANAGER_SHUTDOWN)
+ accessibility_subscription_.reset();
+ else
UpdateA11yState();
- } else {
- NOTREACHED() << "Unexpected notification " << type;
- }
}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698