diff options
Diffstat (limited to 'chrome/browser/ui')
12 files changed, 14 insertions, 16 deletions
diff --git a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm index 9251763..ae57e26 100644 --- a/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm +++ b/chrome/browser/ui/cocoa/clear_browsing_data_controller.mm @@ -83,9 +83,8 @@ static base::LazyInstance<ProfileControllerMap> g_profile_controller_map( if (it == map->end()) { // Since we don't currently support multiple profiles, this class // has not been tested against this case. - if (map->size() != 0) { + if (!map->empty()) return nil; - } ClearBrowsingDataController* controller = [[self alloc] initWithProfile:profile]; diff --git a/chrome/browser/ui/cocoa/cocoa_test_helper.mm b/chrome/browser/ui/cocoa/cocoa_test_helper.mm index b4c68d9..de9c040 100644 --- a/chrome/browser/ui/cocoa/cocoa_test_helper.mm +++ b/chrome/browser/ui/cocoa/cocoa_test_helper.mm @@ -111,7 +111,7 @@ void CocoaTest::TearDown() { // started. std::set<NSWindow*> windows_left(WindowsLeft()); - while (windows_left.size() > 0) { + while (!windows_left.empty()) { // Cover delayed actions by spinning the loop at least once after // this timeout. const NSTimeInterval kCloseTimeoutSeconds = diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm index 45fcea6..9ad68e3 100644 --- a/chrome/browser/ui/cocoa/task_manager_mac.mm +++ b/chrome/browser/ui/cocoa/task_manager_mac.mm @@ -161,7 +161,7 @@ class SortHelper { // Use the model indices to get the new view indices of the selection, and // set selection to that. This assumes that no rows were added or removed // (in that case, the selection is cleared before -reloadData is called). - if (modelSelection.size() > 0) + if (!modelSelection.empty()) DCHECK_EQ([tableView_ numberOfRows], model_->ResourceCount()); NSMutableIndexSet* indexSet = [NSMutableIndexSet indexSet]; for (size_t i = 0; i < modelSelection.size(); ++i) diff --git a/chrome/browser/ui/gtk/dialogs_gtk.cc b/chrome/browser/ui/gtk/dialogs_gtk.cc index 5c18ddb..10d9d57 100644 --- a/chrome/browser/ui/gtk/dialogs_gtk.cc +++ b/chrome/browser/ui/gtk/dialogs_gtk.cc @@ -299,7 +299,7 @@ void SelectFileDialogImpl::AddFilters(GtkFileChooser* chooser) { // Add the *.* filter, but only if we have added other filters (otherwise it // is implied). - if (file_types_.include_all_files && file_types_.extensions.size() > 0) { + if (file_types_.include_all_files && !file_types_.extensions.empty()) { GtkFileFilter* filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter, "*"); gtk_file_filter_set_name(filter, diff --git a/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc b/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc index 2d21122..13d77f2 100644 --- a/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc +++ b/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.cc @@ -122,7 +122,7 @@ void PasswordsExceptionsPageGtk::SetExceptionList( COL_SITE, UTF16ToUTF8(net::FormatUrl(result[i]->origin, languages)).c_str(), -1); } - gtk_widget_set_sensitive(remove_all_button_, result.size() > 0); + gtk_widget_set_sensitive(remove_all_button_, !result.empty()); } void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) { @@ -149,7 +149,7 @@ void PasswordsExceptionsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) { delete exception_list_[index]; exception_list_.erase(exception_list_.begin() + index); - gtk_widget_set_sensitive(remove_all_button_, exception_list_.size() > 0); + gtk_widget_set_sensitive(remove_all_button_, !exception_list_.empty()); } void PasswordsExceptionsPageGtk::OnRemoveAllButtonClicked(GtkWidget* widget) { diff --git a/chrome/browser/ui/gtk/options/passwords_page_gtk.cc b/chrome/browser/ui/gtk/options/passwords_page_gtk.cc index 6eb3b0b..e26cea0 100644 --- a/chrome/browser/ui/gtk/options/passwords_page_gtk.cc +++ b/chrome/browser/ui/gtk/options/passwords_page_gtk.cc @@ -165,7 +165,7 @@ void PasswordsPageGtk::SetPasswordList( UTF16ToUTF8(net::FormatUrl(result[i]->origin, languages)).c_str(), COL_USERNAME, UTF16ToUTF8(result[i]->username_value).c_str(), -1); } - gtk_widget_set_sensitive(remove_all_button_, result.size() > 0); + gtk_widget_set_sensitive(remove_all_button_, !result.empty()); } void PasswordsPageGtk::HidePassword() { @@ -222,7 +222,7 @@ void PasswordsPageGtk::OnRemoveButtonClicked(GtkWidget* widget) { delete password_list_[index]; password_list_.erase(password_list_.begin() + index); - gtk_widget_set_sensitive(remove_all_button_, password_list_.size() > 0); + gtk_widget_set_sensitive(remove_all_button_, !password_list_.empty()); } void PasswordsPageGtk::OnRemoveAllButtonClicked(GtkWidget* widget) { diff --git a/chrome/browser/ui/gtk/rounded_window.cc b/chrome/browser/ui/gtk/rounded_window.cc index 3f8b6e4..79e38e7 100644 --- a/chrome/browser/ui/gtk/rounded_window.cc +++ b/chrome/browser/ui/gtk/rounded_window.cc @@ -232,7 +232,7 @@ gboolean OnRoundedWindowExpose(GtkWidget* widget, // If we want to have borders everywhere, we need to draw a polygon instead // of a set of lines. gdk_draw_polygon(drawable, gc, FALSE, &points[0], points.size()); - } else if (points.size() > 0) { + } else if (!points.empty()) { gdk_draw_lines(drawable, gc, &points[0], points.size()); } diff --git a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc index 13fa63c..00a42b1 100644 --- a/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc +++ b/chrome/browser/ui/toolbar/encoding_menu_controller_unittest.cc @@ -52,7 +52,7 @@ TEST_F(EncodingMenuControllerTest, ListEncodingMenuItems) { controller.GetEncodingMenuItems(&profile_en, &english_items); // Make sure there are items in the lists. - ASSERT_TRUE(english_items.size() > 0); + ASSERT_FALSE(english_items.empty()); // Make sure that autodetect is the first item on both menus ASSERT_EQ(english_items[0].first, IDC_ENCODING_AUTO_DETECT); } diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc index 1a5eadb..84bc69d 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views.cc @@ -256,7 +256,7 @@ bool BookmarkContextMenuControllerViews::IsCommandEnabled(int id) const { case IDC_COPY: case IDC_CUT: - return selection_.size() > 0 && !is_root_node; + return !selection_.empty() && !is_root_node; case IDC_PASTE: // Paste to selection from the Bookmark Bar, to parent_ everywhere else diff --git a/chrome/browser/ui/views/download_shelf_view.cc b/chrome/browser/ui/views/download_shelf_view.cc index 04c713d..b37804f 100644 --- a/chrome/browser/ui/views/download_shelf_view.cc +++ b/chrome/browser/ui/views/download_shelf_view.cc @@ -211,7 +211,7 @@ gfx::Size DownloadShelfView::GetPreferredSize() { AdjustSize(close_button_, &prefsize); AdjustSize(show_all_view_, &prefsize); // Add one download view to the preferred size. - if (download_views_.size() > 0) { + if (!download_views_.empty()) { AdjustSize(*download_views_.begin(), &prefsize); prefsize.Enlarge(kDownloadPadding, 0); } diff --git a/chrome/browser/ui/webui/bug_report_ui.cc b/chrome/browser/ui/webui/bug_report_ui.cc index 82ced3a..1b459bf 100644 --- a/chrome/browser/ui/webui/bug_report_ui.cc +++ b/chrome/browser/ui/webui/bug_report_ui.cc @@ -633,9 +633,8 @@ void BugReportHandler::HandleSendReport(const ListValue* list_value) { // Get the image to send in the report. std::vector<unsigned char> image; - if (screenshot_path.size() > 0) { + if (!screenshot_path.empty()) image = screenshot_source_->GetScreenshot(screenshot_path); - } #if defined(OS_CHROMEOS) if (++i == list_value->end()) { diff --git a/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm b/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm index d3f7c50..5c3253f 100644 --- a/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm +++ b/chrome/browser/ui/window_snapshot/window_snapshot_mac.mm @@ -35,7 +35,7 @@ gfx::Rect GrabWindowSnapshot(gfx::NativeWindow window, return gfx::Rect(); png_representation->assign(buf, buf + length); - DCHECK(png_representation->size() > 0); + DCHECK(!png_representation->empty()); return gfx::Rect(static_cast<int>([rep pixelsWide]), static_cast<int>([rep pixelsHigh])); |