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

Unified Diff: chrome/browser/views/select_profile_dialog.cc

Issue 2253001: Revert 48186, 48196, 48198 (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/syncable/syncable.cc ('k') | chrome/installer/util/l10n_string_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/select_profile_dialog.cc
diff --git a/chrome/browser/views/select_profile_dialog.cc b/chrome/browser/views/select_profile_dialog.cc
index c92c2f89a88bce150d474e814ae8c90bee60f85e..d4af82e9f708da966978e51dd333fb15159d11bf 100644
--- a/chrome/browser/views/select_profile_dialog.cc
+++ b/chrome/browser/views/select_profile_dialog.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -83,8 +83,8 @@ std::wstring SelectProfileDialog::GetWindowTitle() const {
}
bool SelectProfileDialog::Accept() {
- size_t index = profile_combobox_->selected_item();
- if (index > profiles_.size()) {
+ int index = profile_combobox_->selected_item();
+ if (index < 0) {
NOTREACHED();
return true;
}
@@ -93,10 +93,11 @@ bool SelectProfileDialog::Accept() {
// new profile dialog to the user.
if (index == profiles_.size()) {
NewProfileDialog::RunDialog();
- } else {
- std::wstring profile_name = profiles_[index];
- UserDataManager::Get()->LaunchChromeForProfile(profile_name);
+ return true;
}
+
+ std::wstring profile_name = profiles_[index];
+ UserDataManager::Get()->LaunchChromeForProfile(profile_name);
return true;
}
@@ -115,11 +116,10 @@ int SelectProfileDialog::GetItemCount() {
}
std::wstring SelectProfileDialog::GetItemAt(int index) {
- size_t index_size_t = index;
- DCHECK_LE(index_size_t, profiles_.size());
+ DCHECK(index >= 0 && index <= static_cast<int>(profiles_.size()));
// For the last item in the drop down, return the <New Profile> text,
// otherwise return the corresponding profile name from the vector.
- return index_size_t == profiles_.size() ?
+ return index == profiles_.size() ?
l10n_util::GetString(IDS_SELECT_PROFILE_DIALOG_NEW_PROFILE_ENTRY) :
profiles_[index];
}
« no previous file with comments | « chrome/browser/sync/syncable/syncable.cc ('k') | chrome/installer/util/l10n_string_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698