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

Side by Side Diff: chrome/browser/ui/webui/options/handler_options_handler.cc

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/common/chrome_notification_types.h"
13 #include "grit/generated_resources.h" 14 #include "grit/generated_resources.h"
14 #include "ui/base/l10n/l10n_util.h" 15 #include "ui/base/l10n/l10n_util.h"
15 16
16 17
17 HandlerOptionsHandler::HandlerOptionsHandler() { 18 HandlerOptionsHandler::HandlerOptionsHandler() {
18 } 19 }
19 20
20 HandlerOptionsHandler::~HandlerOptionsHandler() { 21 HandlerOptionsHandler::~HandlerOptionsHandler() {
21 } 22 }
22 23
(...skipping 11 matching lines...) Expand all
34 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER }, 35 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER },
35 }; 36 };
36 RegisterTitle(localized_strings, "handlersPage", 37 RegisterTitle(localized_strings, "handlersPage",
37 IDS_HANDLER_OPTIONS_WINDOW_TITLE); 38 IDS_HANDLER_OPTIONS_WINDOW_TITLE);
38 RegisterStrings(localized_strings, resources, arraysize(resources)); 39 RegisterStrings(localized_strings, resources, arraysize(resources));
39 } 40 }
40 41
41 void HandlerOptionsHandler::Initialize() { 42 void HandlerOptionsHandler::Initialize() {
42 UpdateHandlerList(); 43 UpdateHandlerList();
43 notification_registrar_.Add( 44 notification_registrar_.Add(
44 this, NotificationType::PROTOCOL_HANDLER_REGISTRY_CHANGED, 45 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED,
45 NotificationService::AllSources()); 46 NotificationService::AllSources());
46 } 47 }
47 48
48 void HandlerOptionsHandler::RegisterMessages() { 49 void HandlerOptionsHandler::RegisterMessages() {
49 DCHECK(web_ui_); 50 DCHECK(web_ui_);
50 web_ui_->RegisterMessageCallback("clearDefault", 51 web_ui_->RegisterMessageCallback("clearDefault",
51 NewCallback(this, &HandlerOptionsHandler::ClearDefault)); 52 NewCallback(this, &HandlerOptionsHandler::ClearDefault));
52 web_ui_->RegisterMessageCallback("removeHandler", 53 web_ui_->RegisterMessageCallback("removeHandler",
53 NewCallback(this, &HandlerOptionsHandler::RemoveHandler)); 54 NewCallback(this, &HandlerOptionsHandler::RemoveHandler));
54 web_ui_->RegisterMessageCallback("setHandlersEnabled", 55 web_ui_->RegisterMessageCallback("setHandlersEnabled",
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 string16 title; 150 string16 title;
150 bool ok = args->GetString(0, &protocol) && args->GetString(1, &url) && 151 bool ok = args->GetString(0, &protocol) && args->GetString(1, &url) &&
151 args->GetString(2, &title); 152 args->GetString(2, &title);
152 if (!ok) 153 if (!ok)
153 return ProtocolHandler::EmptyProtocolHandler(); 154 return ProtocolHandler::EmptyProtocolHandler();
154 return ProtocolHandler::CreateProtocolHandler(UTF16ToUTF8(protocol), 155 return ProtocolHandler::CreateProtocolHandler(UTF16ToUTF8(protocol),
155 GURL(UTF16ToUTF8(url)), 156 GURL(UTF16ToUTF8(url)),
156 title); 157 title);
157 } 158 }
158 159
159 void HandlerOptionsHandler::Observe(NotificationType type, 160 void HandlerOptionsHandler::Observe(int type,
160 const NotificationSource& source, 161 const NotificationSource& source,
161 const NotificationDetails& details) { 162 const NotificationDetails& details) {
162 if (type == NotificationType::PROTOCOL_HANDLER_REGISTRY_CHANGED) 163 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED)
163 UpdateHandlerList(); 164 UpdateHandlerList();
164 else 165 else
165 NOTREACHED(); 166 NOTREACHED();
166 } 167 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/handler_options_handler.h ('k') | chrome/browser/ui/webui/options/options_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698