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

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

Issue 2924943002: MD Settings/On Startup: ignore current tab when using current pages (Closed)
Patch Set: ignore_contents Created 3 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 <utility> 9 #include <utility>
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void StartupPagesHandler::OnItemsAdded(int start, int length) { 143 void StartupPagesHandler::OnItemsAdded(int start, int length) {
144 OnModelChanged(); 144 OnModelChanged();
145 } 145 }
146 146
147 void StartupPagesHandler::OnItemsRemoved(int start, int length) { 147 void StartupPagesHandler::OnItemsRemoved(int start, int length) {
148 OnModelChanged(); 148 OnModelChanged();
149 } 149 }
150 150
151 void StartupPagesHandler::SetStartupPagesToCurrentPages( 151 void StartupPagesHandler::SetStartupPagesToCurrentPages(
152 const base::ListValue* args) { 152 const base::ListValue* args) {
153 startup_custom_pages_table_model_->SetToCurrentlyOpenPages(); 153 startup_custom_pages_table_model_->SetToCurrentlyOpenPages(
154 web_ui()->GetWebContents());
154 } 155 }
155 156
156 void StartupPagesHandler::RemoveStartupPages(const base::ListValue* args) { 157 void StartupPagesHandler::RemoveStartupPages(const base::ListValue* args) {
157 for (int i = args->GetSize() - 1; i >= 0; --i) { 158 for (int i = args->GetSize() - 1; i >= 0; --i) {
158 int selected_index; 159 int selected_index;
159 CHECK(args->GetInteger(i, &selected_index)); 160 CHECK(args->GetInteger(i, &selected_index));
160 161
161 if (selected_index < 0 || 162 if (selected_index < 0 ||
162 selected_index >= startup_custom_pages_table_model_->RowCount()) { 163 selected_index >= startup_custom_pages_table_model_->RowCount()) {
163 NOTREACHED(); 164 NOTREACHED();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 263
263 void StartupPagesHandler::OnResultChanged(bool default_match_changed) { 264 void StartupPagesHandler::OnResultChanged(bool default_match_changed) {
264 const AutocompleteResult& result = autocomplete_controller_->result(); 265 const AutocompleteResult& result = autocomplete_controller_->result();
265 base::ListValue suggestions; 266 base::ListValue suggestions;
266 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); 267 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions);
267 web_ui()->CallJavascriptFunctionUnsafe( 268 web_ui()->CallJavascriptFunctionUnsafe(
268 "StartupOverlay.updateAutocompleteSuggestions", suggestions); 269 "StartupOverlay.updateAutocompleteSuggestions", suggestions);
269 } 270 }
270 271
271 } // namespace options 272 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/custom_home_pages_table_model.cc ('k') | chrome/browser/ui/webui/settings/settings_startup_pages_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698