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/options2/startup_pages_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/startup_pages_handler2.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" | 10 #include "chrome/browser/autocomplete/autocomplete_controller_delegate.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 StartupPagesHandler::~StartupPagesHandler() { | 30 StartupPagesHandler::~StartupPagesHandler() { |
31 | 31 |
32 } | 32 } |
33 | 33 |
34 void StartupPagesHandler::GetLocalizedValues( | 34 void StartupPagesHandler::GetLocalizedValues( |
35 DictionaryValue* localized_strings) { | 35 DictionaryValue* localized_strings) { |
36 DCHECK(localized_strings); | 36 DCHECK(localized_strings); |
37 | 37 |
38 static OptionsStringResource resources[] = { | 38 static OptionsStringResource resources[] = { |
39 { "startupAddLabel", IDS_OPTIONS_STARTUP_ADD_LABEL }, | 39 { "startupAddLabel", IDS_OPTIONS_STARTUP_ADD_LABEL }, |
40 { "startupPagesDialogTitle", IDS_OPTIONS2_STARTUP_PAGES_DIALOG_TITLE }, | |
41 { "startupUseCurrent", IDS_OPTIONS_STARTUP_USE_CURRENT }, | 40 { "startupUseCurrent", IDS_OPTIONS_STARTUP_USE_CURRENT }, |
42 { "startupPagesPlaceholder", IDS_OPTIONS_STARTUP_PAGES_PLACEHOLDER }, | 41 { "startupPagesPlaceholder", IDS_OPTIONS_STARTUP_PAGES_PLACEHOLDER }, |
43 }; | 42 }; |
44 | 43 |
45 RegisterStrings(localized_strings, resources, arraysize(resources)); | 44 RegisterStrings(localized_strings, resources, arraysize(resources)); |
46 | 45 RegisterTitle(localized_strings, "startupPagesOverlay", |
| 46 IDS_OPTIONS2_STARTUP_PAGES_DIALOG_TITLE); |
47 } | 47 } |
48 | 48 |
49 void StartupPagesHandler::RegisterMessages() { | 49 void StartupPagesHandler::RegisterMessages() { |
50 web_ui()->RegisterMessageCallback("removeStartupPages", | 50 web_ui()->RegisterMessageCallback("removeStartupPages", |
51 base::Bind(&StartupPagesHandler::RemoveStartupPages, | 51 base::Bind(&StartupPagesHandler::RemoveStartupPages, |
52 base::Unretained(this))); | 52 base::Unretained(this))); |
53 web_ui()->RegisterMessageCallback("addStartupPage", | 53 web_ui()->RegisterMessageCallback("addStartupPage", |
54 base::Bind(&StartupPagesHandler::AddStartupPage, | 54 base::Bind(&StartupPagesHandler::AddStartupPage, |
55 base::Unretained(this))); | 55 base::Unretained(this))); |
56 web_ui()->RegisterMessageCallback("editStartupPage", | 56 web_ui()->RegisterMessageCallback("editStartupPage", |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 entry->SetString("displayURL", match.contents); | 260 entry->SetString("displayURL", match.contents); |
261 entry->SetString("url", match.destination_url.spec()); | 261 entry->SetString("url", match.destination_url.spec()); |
262 suggestions.Append(entry); | 262 suggestions.Append(entry); |
263 } | 263 } |
264 | 264 |
265 web_ui()->CallJavascriptFunction( | 265 web_ui()->CallJavascriptFunction( |
266 "StartupOverlay.updateAutocompleteSuggestions", suggestions); | 266 "StartupOverlay.updateAutocompleteSuggestions", suggestions); |
267 } | 267 } |
268 | 268 |
269 } // namespace options2 | 269 } // namespace options2 |
OLD | NEW |