| OLD | NEW |
| 1 // Copyright (c) 2011 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/options/handler_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/handler_options_handler.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" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 36 { "handlers_remove_link", IDS_HANDLERS_REMOVE_HANDLER_LINK }, | 36 { "handlers_remove_link", IDS_HANDLERS_REMOVE_HANDLER_LINK }, |
| 37 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER }, | 37 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER }, |
| 38 { "handlers_active_heading", IDS_HANDLERS_ACTIVE_HEADING }, | 38 { "handlers_active_heading", IDS_HANDLERS_ACTIVE_HEADING }, |
| 39 { "handlers_ignored_heading", IDS_HANDLERS_IGNORED_HEADING }, | 39 { "handlers_ignored_heading", IDS_HANDLERS_IGNORED_HEADING }, |
| 40 }; | 40 }; |
| 41 RegisterTitle(localized_strings, "handlersPage", | 41 RegisterTitle(localized_strings, "handlersPage", |
| 42 IDS_HANDLER_OPTIONS_WINDOW_TITLE); | 42 IDS_HANDLER_OPTIONS_WINDOW_TITLE); |
| 43 RegisterStrings(localized_strings, resources, arraysize(resources)); | 43 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void HandlerOptionsHandler::Initialize() { | 46 void HandlerOptionsHandler::InitializeHandler() { |
| 47 UpdateHandlerList(); | 47 UpdateHandlerList(); |
| 48 notification_registrar_.Add( | 48 notification_registrar_.Add( |
| 49 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, | 49 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, |
| 50 content::Source<Profile>(Profile::FromWebUI(web_ui()))); | 50 content::Source<Profile>(Profile::FromWebUI(web_ui()))); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void HandlerOptionsHandler::RegisterMessages() { | 53 void HandlerOptionsHandler::RegisterMessages() { |
| 54 web_ui()->RegisterMessageCallback("clearDefault", | 54 web_ui()->RegisterMessageCallback("clearDefault", |
| 55 base::Bind(&HandlerOptionsHandler::ClearDefault, | 55 base::Bind(&HandlerOptionsHandler::ClearDefault, |
| 56 base::Unretained(this))); | 56 base::Unretained(this))); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 196 |
| 197 void HandlerOptionsHandler::Observe( | 197 void HandlerOptionsHandler::Observe( |
| 198 int type, | 198 int type, |
| 199 const content::NotificationSource& source, | 199 const content::NotificationSource& source, |
| 200 const content::NotificationDetails& details) { | 200 const content::NotificationDetails& details) { |
| 201 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) | 201 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) |
| 202 UpdateHandlerList(); | 202 UpdateHandlerList(); |
| 203 else | 203 else |
| 204 NOTREACHED(); | 204 NOTREACHED(); |
| 205 } | 205 } |
| OLD | NEW |