OLD | NEW |
1 // Copyright (c) 2010 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 "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 printable_selection_text)); | 613 printable_selection_text)); |
614 } | 614 } |
615 } else { | 615 } else { |
616 const TemplateURL* const default_provider = | 616 const TemplateURL* const default_provider = |
617 profile_->GetTemplateURLModel()->GetDefaultSearchProvider(); | 617 profile_->GetTemplateURLModel()->GetDefaultSearchProvider(); |
618 if (!default_provider) | 618 if (!default_provider) |
619 return; | 619 return; |
620 menu_model_.AddItem( | 620 menu_model_.AddItem( |
621 IDC_CONTENT_CONTEXT_SEARCHWEBFOR, | 621 IDC_CONTENT_CONTEXT_SEARCHWEBFOR, |
622 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_SEARCHWEBFOR, | 622 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_SEARCHWEBFOR, |
623 WideToUTF16(default_provider->short_name()), | 623 default_provider->short_name(), |
624 printable_selection_text)); | 624 printable_selection_text)); |
625 } | 625 } |
626 } | 626 } |
627 | 627 |
628 void RenderViewContextMenu::AppendEditableItems() { | 628 void RenderViewContextMenu::AppendEditableItems() { |
629 // Append Dictionary spell check suggestions. | 629 // Append Dictionary spell check suggestions. |
630 for (size_t i = 0; i < params_.dictionary_suggestions.size() && | 630 for (size_t i = 0; i < params_.dictionary_suggestions.size() && |
631 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; | 631 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; |
632 ++i) { | 632 ++i) { |
633 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), | 633 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1477 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1478 g_browser_process->clipboard()); | 1478 g_browser_process->clipboard()); |
1479 } | 1479 } |
1480 | 1480 |
1481 void RenderViewContextMenu::MediaPlayerActionAt( | 1481 void RenderViewContextMenu::MediaPlayerActionAt( |
1482 const gfx::Point& location, | 1482 const gfx::Point& location, |
1483 const WebMediaPlayerAction& action) { | 1483 const WebMediaPlayerAction& action) { |
1484 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1484 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
1485 location, action); | 1485 location, action); |
1486 } | 1486 } |
OLD | NEW |