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

Side by Side Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 7
8 #include "chrome/browser/tab_contents/render_view_context_menu.h" 8 #include "chrome/browser/tab_contents/render_view_context_menu.h"
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 708 }
709 709
710 void RenderViewContextMenu::AppendEditableItems() { 710 void RenderViewContextMenu::AppendEditableItems() {
711 // Append Dictionary spell check suggestions. 711 // Append Dictionary spell check suggestions.
712 for (size_t i = 0; i < params_.dictionary_suggestions.size() && 712 for (size_t i = 0; i < params_.dictionary_suggestions.size() &&
713 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; 713 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST;
714 ++i) { 714 ++i) {
715 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), 715 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i),
716 params_.dictionary_suggestions[i]); 716 params_.dictionary_suggestions[i]);
717 } 717 }
718 if (params_.dictionary_suggestions.size() > 0) 718 if (!params_.dictionary_suggestions.empty())
719 menu_model_.AddSeparator(); 719 menu_model_.AddSeparator();
720 720
721 // If word is misspelled, give option for "Add to dictionary" 721 // If word is misspelled, give option for "Add to dictionary"
722 if (!params_.misspelled_word.empty()) { 722 if (!params_.misspelled_word.empty()) {
723 if (params_.dictionary_suggestions.empty()) { 723 if (params_.dictionary_suggestions.empty()) {
724 menu_model_.AddItem(0, 724 menu_model_.AddItem(0,
725 l10n_util::GetStringUTF16( 725 l10n_util::GetStringUTF16(
726 IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS)); 726 IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS));
727 } 727 }
728 menu_model_.AddItemWithStringId(IDC_SPELLCHECK_ADD_TO_DICTIONARY, 728 menu_model_.AddItemWithStringId(IDC_SPELLCHECK_ADD_TO_DICTIONARY,
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), 1532 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
1533 g_browser_process->clipboard()); 1533 g_browser_process->clipboard());
1534 } 1534 }
1535 1535
1536 void RenderViewContextMenu::MediaPlayerActionAt( 1536 void RenderViewContextMenu::MediaPlayerActionAt(
1537 const gfx::Point& location, 1537 const gfx::Point& location,
1538 const WebMediaPlayerAction& action) { 1538 const WebMediaPlayerAction& action) {
1539 source_tab_contents_->render_view_host()->MediaPlayerActionAt( 1539 source_tab_contents_->render_view_host()->MediaPlayerActionAt(
1540 location, action); 1540 location, action);
1541 } 1541 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | chrome/browser/ui/cocoa/clear_browsing_data_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698