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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 printable_selection_text)); | 598 printable_selection_text)); |
599 } | 599 } |
600 } else { | 600 } else { |
601 const TemplateURL* const default_provider = | 601 const TemplateURL* const default_provider = |
602 profile_->GetTemplateURLModel()->GetDefaultSearchProvider(); | 602 profile_->GetTemplateURLModel()->GetDefaultSearchProvider(); |
603 if (!default_provider) | 603 if (!default_provider) |
604 return; | 604 return; |
605 menu_model_.AddItem( | 605 menu_model_.AddItem( |
606 IDC_CONTENT_CONTEXT_SEARCHWEBFOR, | 606 IDC_CONTENT_CONTEXT_SEARCHWEBFOR, |
607 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_SEARCHWEBFOR, | 607 l10n_util::GetStringFUTF16(IDS_CONTENT_CONTEXT_SEARCHWEBFOR, |
608 WideToUTF16(default_provider->short_name()), | 608 default_provider->short_name(), |
609 printable_selection_text)); | 609 printable_selection_text)); |
610 } | 610 } |
611 } | 611 } |
612 | 612 |
613 void RenderViewContextMenu::AppendEditableItems() { | 613 void RenderViewContextMenu::AppendEditableItems() { |
614 // Append Dictionary spell check suggestions. | 614 // Append Dictionary spell check suggestions. |
615 for (size_t i = 0; i < params_.dictionary_suggestions.size() && | 615 for (size_t i = 0; i < params_.dictionary_suggestions.size() && |
616 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; | 616 IDC_SPELLCHECK_SUGGESTION_0 + i <= IDC_SPELLCHECK_SUGGESTION_LAST; |
617 ++i) { | 617 ++i) { |
618 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), | 618 menu_model_.AddItem(IDC_SPELLCHECK_SUGGESTION_0 + static_cast<int>(i), |
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1451 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1452 g_browser_process->clipboard()); | 1452 g_browser_process->clipboard()); |
1453 } | 1453 } |
1454 | 1454 |
1455 void RenderViewContextMenu::MediaPlayerActionAt( | 1455 void RenderViewContextMenu::MediaPlayerActionAt( |
1456 const gfx::Point& location, | 1456 const gfx::Point& location, |
1457 const WebMediaPlayerAction& action) { | 1457 const WebMediaPlayerAction& action) { |
1458 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1458 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
1459 location, action); | 1459 location, action); |
1460 } | 1460 } |
OLD | NEW |