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

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

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
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/startup_pages_handler.h" 5 #include "chrome/browser/ui/webui/options/startup_pages_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 for (int i = 0; i < page_count; ++i) { 123 for (int i = 0; i < page_count; ++i) {
124 base::DictionaryValue* entry = new base::DictionaryValue(); 124 base::DictionaryValue* entry = new base::DictionaryValue();
125 entry->SetString("title", startup_custom_pages_table_model_->GetText(i, 0)); 125 entry->SetString("title", startup_custom_pages_table_model_->GetText(i, 0));
126 entry->SetString("url", urls[i].spec()); 126 entry->SetString("url", urls[i].spec());
127 entry->SetString("tooltip", 127 entry->SetString("tooltip",
128 startup_custom_pages_table_model_->GetTooltip(i)); 128 startup_custom_pages_table_model_->GetTooltip(i));
129 entry->SetInteger("modelIndex", i); 129 entry->SetInteger("modelIndex", i);
130 startup_pages.Append(entry); 130 startup_pages.Append(entry);
131 } 131 }
132 132
133 web_ui()->CallJavascriptFunction("StartupOverlay.updateStartupPages", 133 web_ui()->CallJavascriptFunctionUnsafe("StartupOverlay.updateStartupPages",
134 startup_pages); 134 startup_pages);
135 } 135 }
136 136
137 void StartupPagesHandler::OnItemsChanged(int start, int length) { 137 void StartupPagesHandler::OnItemsChanged(int start, int length) {
138 OnModelChanged(); 138 OnModelChanged();
139 } 139 }
140 140
141 void StartupPagesHandler::OnItemsAdded(int start, int length) { 141 void StartupPagesHandler::OnItemsAdded(int start, int length) {
142 OnModelChanged(); 142 OnModelChanged();
143 } 143 }
144 144
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 autocomplete_controller_->Start(AutocompleteInput( 255 autocomplete_controller_->Start(AutocompleteInput(
256 input, base::string16::npos, std::string(), GURL(), 256 input, base::string16::npos, std::string(), GURL(),
257 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true, false, 257 metrics::OmniboxEventProto::INVALID_SPEC, true, false, false, true, false,
258 ChromeAutocompleteSchemeClassifier(Profile::FromWebUI(web_ui())))); 258 ChromeAutocompleteSchemeClassifier(Profile::FromWebUI(web_ui()))));
259 } 259 }
260 260
261 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { 261 void StartupPagesHandler::OnResultChanged(bool default_match_changed) {
262 const AutocompleteResult& result = autocomplete_controller_->result(); 262 const AutocompleteResult& result = autocomplete_controller_->result();
263 base::ListValue suggestions; 263 base::ListValue suggestions;
264 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); 264 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions);
265 web_ui()->CallJavascriptFunction( 265 web_ui()->CallJavascriptFunctionUnsafe(
266 "StartupOverlay.updateAutocompleteSuggestions", suggestions); 266 "StartupOverlay.updateAutocompleteSuggestions", suggestions);
267 } 267 }
268 268
269 } // namespace options 269 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698