| 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/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" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 } | 31 } |
| 32 | 32 |
| 33 HandlerOptionsHandler::~HandlerOptionsHandler() { | 33 HandlerOptionsHandler::~HandlerOptionsHandler() { |
| 34 } | 34 } |
| 35 | 35 |
| 36 void HandlerOptionsHandler::GetLocalizedValues( | 36 void HandlerOptionsHandler::GetLocalizedValues( |
| 37 base::DictionaryValue* localized_strings) { | 37 base::DictionaryValue* localized_strings) { |
| 38 DCHECK(localized_strings); | 38 DCHECK(localized_strings); |
| 39 | 39 |
| 40 static OptionsStringResource resources[] = { | 40 static OptionsStringResource resources[] = { |
| 41 { "handlers_tab_label", IDS_HANDLERS_TAB_LABEL }, | 41 {"handlersTabLabel", IDS_HANDLERS_TAB_LABEL}, |
| 42 { "handlers_allow", IDS_HANDLERS_ALLOW_RADIO }, | 42 {"handlersAllow", IDS_HANDLERS_ALLOW_RADIO}, |
| 43 { "handlers_block", IDS_HANDLERS_DONOTALLOW_RADIO }, | 43 {"handlersBlock", IDS_HANDLERS_DONOTALLOW_RADIO}, |
| 44 { "handlers_type_column_header", IDS_HANDLERS_TYPE_COLUMN_HEADER }, | 44 {"handlersTypeColumnHeader", IDS_HANDLERS_TYPE_COLUMN_HEADER}, |
| 45 { "handlers_site_column_header", IDS_HANDLERS_SITE_COLUMN_HEADER }, | 45 {"handlersSiteColumnHeader", IDS_HANDLERS_SITE_COLUMN_HEADER}, |
| 46 { "handlers_remove_link", IDS_HANDLERS_REMOVE_HANDLER_LINK }, | 46 {"handlersRemoveLink", IDS_HANDLERS_REMOVE_HANDLER_LINK}, |
| 47 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER }, | 47 {"handlersNoneHandler", IDS_HANDLERS_NONE_HANDLER}, |
| 48 { "handlers_active_heading", IDS_HANDLERS_ACTIVE_HEADING }, | 48 {"handlersActiveHeading", IDS_HANDLERS_ACTIVE_HEADING}, |
| 49 { "handlers_ignored_heading", IDS_HANDLERS_IGNORED_HEADING }, | 49 {"handlersIgnoredHeading", IDS_HANDLERS_IGNORED_HEADING}, |
| 50 }; | 50 }; |
| 51 RegisterTitle(localized_strings, "handlersPage", | 51 RegisterTitle(localized_strings, "handlersPage", |
| 52 IDS_HANDLER_OPTIONS_WINDOW_TITLE); | 52 IDS_HANDLER_OPTIONS_WINDOW_TITLE); |
| 53 RegisterStrings(localized_strings, resources, arraysize(resources)); | 53 RegisterStrings(localized_strings, resources, arraysize(resources)); |
| 54 | 54 |
| 55 localized_strings->SetString("handlers_learn_more_url", | 55 localized_strings->SetString("handlersLearnMoreUrl", kHandlersLearnMoreUrl); |
| 56 kHandlersLearnMoreUrl); | |
| 57 } | 56 } |
| 58 | 57 |
| 59 void HandlerOptionsHandler::InitializeHandler() { | 58 void HandlerOptionsHandler::InitializeHandler() { |
| 60 notification_registrar_.Add( | 59 notification_registrar_.Add( |
| 61 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, | 60 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, |
| 62 content::Source<Profile>(Profile::FromWebUI(web_ui()))); | 61 content::Source<Profile>(Profile::FromWebUI(web_ui()))); |
| 63 } | 62 } |
| 64 | 63 |
| 65 void HandlerOptionsHandler::InitializePage() { | 64 void HandlerOptionsHandler::InitializePage() { |
| 66 UpdateHandlerList(); | 65 UpdateHandlerList(); |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 int type, | 215 int type, |
| 217 const content::NotificationSource& source, | 216 const content::NotificationSource& source, |
| 218 const content::NotificationDetails& details) { | 217 const content::NotificationDetails& details) { |
| 219 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) | 218 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) |
| 220 UpdateHandlerList(); | 219 UpdateHandlerList(); |
| 221 else | 220 else |
| 222 NOTREACHED(); | 221 NOTREACHED(); |
| 223 } | 222 } |
| 224 | 223 |
| 225 } // namespace options | 224 } // namespace options |
| OLD | NEW |