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

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

Issue 2081007: Enable warning 4389 as an error on windows builds. This will make... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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_frame/chrome_active_document.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
===================================================================
--- chrome/browser/views/select_profile_dialog.cc (revision 48060)
+++ chrome/browser/views/select_profile_dialog.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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 @@
}
bool SelectProfileDialog::Accept() {
- int index = profile_combobox_->selected_item();
- if (index < 0) {
+ size_t index = profile_combobox_->selected_item();
+ if (index > profiles_.size()) {
NOTREACHED();
return true;
}
@@ -93,11 +93,10 @@
// new profile dialog to the user.
if (index == profiles_.size()) {
NewProfileDialog::RunDialog();
- return true;
+ } else {
+ std::wstring profile_name = profiles_[index];
+ UserDataManager::Get()->LaunchChromeForProfile(profile_name);
}
-
- std::wstring profile_name = profiles_[index];
- UserDataManager::Get()->LaunchChromeForProfile(profile_name);
return true;
}
@@ -116,10 +115,11 @@
}
std::wstring SelectProfileDialog::GetItemAt(int index) {
- DCHECK(index >= 0 && index <= static_cast<int>(profiles_.size()));
+ size_t index_size_t = index;
+ DCHECK_LE(index_size_t, 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 == profiles_.size() ?
+ return index_size_t == 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_frame/chrome_active_document.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698