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

Side by Side Diff: chrome/browser/dom_ui/options/add_startup_page_handler.cc

Issue 6044007: Remove wstring from TableModel.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/options/add_startup_page_handler.h" 5 #include "chrome/browser/dom_ui/options/add_startup_page_handler.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 scoped_ptr<Value> url_value(Value::CreateStringValue(url_string)); 69 scoped_ptr<Value> url_value(Value::CreateStringValue(url_string));
70 dom_ui_->CallJavascriptFunction(L"AddStartupPageOverlay.setInputFieldValue", 70 dom_ui_->CallJavascriptFunction(L"AddStartupPageOverlay.setInputFieldValue",
71 *url_value.get()); 71 *url_value.get());
72 } 72 }
73 73
74 void AddStartupPageHandler::OnModelChanged() { 74 void AddStartupPageHandler::OnModelChanged() {
75 ListValue pages; 75 ListValue pages;
76 for (int i = 0; i < url_table_model_->RowCount(); ++i) { 76 for (int i = 0; i < url_table_model_->RowCount(); ++i) {
77 DictionaryValue* dict = new DictionaryValue(); 77 DictionaryValue* dict = new DictionaryValue();
78 dict->SetString("title", WideToUTF16Hack(url_table_model_->GetText( 78 dict->SetString("title", url_table_model_->GetText(i, IDS_ASI_PAGE_COLUMN));
79 i, IDS_ASI_PAGE_COLUMN))); 79 dict->SetString("displayURL", url_table_model_->GetText(
viettrungluu 2010/12/29 23:41:17 Micro-nit: I think this would look nicer if you br
Avi (use Gerrit) 2010/12/30 00:04:15 Done.
80 dict->SetString("displayURL", WideToUTF16Hack(url_table_model_->GetText( 80 i, IDS_ASI_URL_COLUMN));
81 i, IDS_ASI_URL_COLUMN)));
82 dict->SetString("url", url_table_model_->GetURL(i).spec()); 81 dict->SetString("url", url_table_model_->GetURL(i).spec());
83 pages.Append(dict); 82 pages.Append(dict);
84 } 83 }
85 84
86 dom_ui_->CallJavascriptFunction(L"AddStartupPageOverlay.updateRecentPageList", 85 dom_ui_->CallJavascriptFunction(L"AddStartupPageOverlay.updateRecentPageList",
87 pages); 86 pages);
88 } 87 }
89 88
90 void AddStartupPageHandler::OnItemsChanged(int start, int length) { 89 void AddStartupPageHandler::OnItemsChanged(int start, int length) {
91 OnModelChanged(); 90 OnModelChanged();
92 } 91 }
93 92
94 void AddStartupPageHandler::OnItemsAdded(int start, int length) { 93 void AddStartupPageHandler::OnItemsAdded(int start, int length) {
95 OnModelChanged(); 94 OnModelChanged();
96 } 95 }
97 96
98 void AddStartupPageHandler::OnItemsRemoved(int start, int length) { 97 void AddStartupPageHandler::OnItemsRemoved(int start, int length) {
99 OnModelChanged(); 98 OnModelChanged();
100 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698