summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/options
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 17:09:36 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 17:09:36 +0000
commit1e2d1c3592e26ff43277b34fad848f6b3e98f17a (patch)
tree7b16527371e9e23bd0f83984f2b17f25a9f737f2 /chrome/browser/views/options
parentf242505d4eaaf48c669d79eb7d95385e7c5b9fb8 (diff)
downloadchromium_src-1e2d1c3592e26ff43277b34fad848f6b3e98f17a.zip
chromium_src-1e2d1c3592e26ff43277b34fad848f6b3e98f17a.tar.gz
chromium_src-1e2d1c3592e26ff43277b34fad848f6b3e98f17a.tar.bz2
A patch from contributor Thiago Farina:
[Windows] Improve the usage of "Open the following pages:" table. - Allow multiple selection. - Select the next row after the last row deleted or nothing when the row doesn't have any items. - Select the item in table when the user add an url. BUG=19150 TEST=add a bunch of urls, remove them, in different orders, should work fine. Review URL: http://codereview.chromium.org/267094 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28976 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/options')
-rw-r--r--chrome/browser/views/options/general_page_view.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc
index e7f9b37..af3fa6b 100644
--- a/chrome/browser/views/options/general_page_view.cc
+++ b/chrome/browser/views/options/general_page_view.cc
@@ -696,7 +696,7 @@ void GeneralPageView::InitStartupGroup() {
columns.push_back(TableColumn());
startup_custom_pages_table_ = new views::TableView(
startup_custom_pages_table_model_.get(), columns,
- views::ICON_AND_TEXT, true, false, true);
+ views::ICON_AND_TEXT, false, false, true);
// URLs are inherently left-to-right, so do not mirror the table.
startup_custom_pages_table_->EnableUIMirroringForRTLLanguages(false);
startup_custom_pages_table_->SetObserver(this);
@@ -902,10 +902,20 @@ void GeneralPageView::AddURLToStartupURLs() {
}
void GeneralPageView::RemoveURLsFromStartupURLs() {
+ int selected_row = 0;
for (views::TableView::iterator i =
startup_custom_pages_table_->SelectionBegin();
i != startup_custom_pages_table_->SelectionEnd(); ++i) {
startup_custom_pages_table_model_->Remove(*i);
+ selected_row = *i;
+ }
+ int row_count = startup_custom_pages_table_->RowCount();
+ if (selected_row >= row_count)
+ selected_row = row_count - 1;
+ if (selected_row >= 0) {
+ // Select the next row after the last row deleted, or the above item if the
+ // latest item was deleted or nothing when the table doesn't have any items.
+ startup_custom_pages_table_->Select(selected_row);
}
SaveStartupPref();
}
@@ -953,6 +963,7 @@ void GeneralPageView::AddBookmark(UrlPicker* dialog,
else
index++;
startup_custom_pages_table_model_->Add(index, url);
+ startup_custom_pages_table_->Select(index);
SaveStartupPref();
}