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

Side by Side Diff: chrome/browser/ui/webui/options2/handler_options_handler2.cc

Issue 9693032: [uber page] Split up initialization of handlers from initialization of webui pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
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/options2/handler_options_handler2.h" 5 #include "chrome/browser/ui/webui/options2/handler_options_handler2.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 28 matching lines...) Expand all
39 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER }, 39 { "handlers_none_handler", IDS_HANDLERS_NONE_HANDLER },
40 { "handlers_active_heading", IDS_HANDLERS_ACTIVE_HEADING }, 40 { "handlers_active_heading", IDS_HANDLERS_ACTIVE_HEADING },
41 { "handlers_ignored_heading", IDS_HANDLERS_IGNORED_HEADING }, 41 { "handlers_ignored_heading", IDS_HANDLERS_IGNORED_HEADING },
42 }; 42 };
43 RegisterTitle(localized_strings, "handlersPage", 43 RegisterTitle(localized_strings, "handlersPage",
44 IDS_HANDLER_OPTIONS_WINDOW_TITLE); 44 IDS_HANDLER_OPTIONS_WINDOW_TITLE);
45 RegisterStrings(localized_strings, resources, arraysize(resources)); 45 RegisterStrings(localized_strings, resources, arraysize(resources));
46 } 46 }
47 47
48 void HandlerOptionsHandler::Initialize() { 48 void HandlerOptionsHandler::Initialize() {
49 UpdateHandlerList();
50 notification_registrar_.Add( 49 notification_registrar_.Add(
51 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, 50 this, chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED,
52 content::Source<Profile>(Profile::FromWebUI(web_ui()))); 51 content::Source<Profile>(Profile::FromWebUI(web_ui())));
53 } 52 }
54 53
54 void HandlerOptionsHandler::SendPageValues() {
55 UpdateHandlerList();
56 }
57
55 void HandlerOptionsHandler::RegisterMessages() { 58 void HandlerOptionsHandler::RegisterMessages() {
56 web_ui()->RegisterMessageCallback("clearDefault", 59 web_ui()->RegisterMessageCallback("clearDefault",
57 base::Bind(&HandlerOptionsHandler::ClearDefault, 60 base::Bind(&HandlerOptionsHandler::ClearDefault,
58 base::Unretained(this))); 61 base::Unretained(this)));
59 web_ui()->RegisterMessageCallback("removeHandler", 62 web_ui()->RegisterMessageCallback("removeHandler",
60 base::Bind(&HandlerOptionsHandler::RemoveHandler, 63 base::Bind(&HandlerOptionsHandler::RemoveHandler,
61 base::Unretained(this))); 64 base::Unretained(this)));
62 web_ui()->RegisterMessageCallback("setHandlersEnabled", 65 web_ui()->RegisterMessageCallback("setHandlersEnabled",
63 base::Bind(&HandlerOptionsHandler::SetHandlersEnabled, 66 base::Bind(&HandlerOptionsHandler::SetHandlersEnabled,
64 base::Unretained(this))); 67 base::Unretained(this)));
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 int type, 203 int type,
201 const content::NotificationSource& source, 204 const content::NotificationSource& source,
202 const content::NotificationDetails& details) { 205 const content::NotificationDetails& details) {
203 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) 206 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED)
204 UpdateHandlerList(); 207 UpdateHandlerList();
205 else 208 else
206 NOTREACHED(); 209 NOTREACHED();
207 } 210 }
208 211
209 } // namespace options2 212 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698