OLD | NEW |
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 #include "content/browser/download/download_manager.h" | 57 #include "content/browser/download/download_manager.h" |
58 #include "content/browser/download/download_stats.h" | 58 #include "content/browser/download/download_stats.h" |
59 #include "content/browser/download/save_package.h" | 59 #include "content/browser/download/save_package.h" |
60 #include "content/browser/renderer_host/render_view_host.h" | 60 #include "content/browser/renderer_host/render_view_host.h" |
61 #include "content/browser/renderer_host/render_widget_host_view.h" | 61 #include "content/browser/renderer_host/render_widget_host_view.h" |
62 #include "content/browser/speech/speech_input_preferences.h" | 62 #include "content/browser/speech/speech_input_preferences.h" |
63 #include "content/browser/tab_contents/navigation_details.h" | 63 #include "content/browser/tab_contents/navigation_details.h" |
64 #include "content/browser/tab_contents/navigation_entry.h" | 64 #include "content/browser/tab_contents/navigation_entry.h" |
65 #include "content/browser/tab_contents/tab_contents.h" | 65 #include "content/browser/tab_contents/tab_contents.h" |
66 #include "content/browser/user_metrics.h" | 66 #include "content/browser/user_metrics.h" |
67 #include "content/common/content_restriction.h" | |
68 #include "content/public/browser/notification_service.h" | 67 #include "content/public/browser/notification_service.h" |
| 68 #include "content/public/common/content_restriction.h" |
69 #include "grit/generated_resources.h" | 69 #include "grit/generated_resources.h" |
70 #include "net/base/escape.h" | 70 #include "net/base/escape.h" |
71 #include "net/base/net_util.h" | 71 #include "net/base/net_util.h" |
72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" | 73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.
h" |
74 #include "ui/base/l10n/l10n_util.h" | 74 #include "ui/base/l10n/l10n_util.h" |
75 #include "ui/base/text/text_elider.h" | 75 #include "ui/base/text/text_elider.h" |
76 #include "ui/gfx/favicon_size.h" | 76 #include "ui/gfx/favicon_size.h" |
77 #include "webkit/glue/webmenuitem.h" | 77 #include "webkit/glue/webmenuitem.h" |
78 | 78 |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 // observer. | 993 // observer. |
994 ObserverListBase<RenderViewContextMenuObserver>::Iterator it(observers_); | 994 ObserverListBase<RenderViewContextMenuObserver>::Iterator it(observers_); |
995 RenderViewContextMenuObserver* observer; | 995 RenderViewContextMenuObserver* observer; |
996 while ((observer = it.GetNext()) != NULL) { | 996 while ((observer = it.GetNext()) != NULL) { |
997 if (observer->IsCommandIdSupported(id)) | 997 if (observer->IsCommandIdSupported(id)) |
998 return observer->IsCommandIdEnabled(id); | 998 return observer->IsCommandIdEnabled(id); |
999 } | 999 } |
1000 | 1000 |
1001 if (id == IDC_PRINT && | 1001 if (id == IDC_PRINT && |
1002 (source_tab_contents_->content_restrictions() & | 1002 (source_tab_contents_->content_restrictions() & |
1003 CONTENT_RESTRICTION_PRINT)) { | 1003 content::CONTENT_RESTRICTION_PRINT)) { |
1004 return false; | 1004 return false; |
1005 } | 1005 } |
1006 | 1006 |
1007 if (id == IDC_SAVE_PAGE && | 1007 if (id == IDC_SAVE_PAGE && |
1008 (source_tab_contents_->content_restrictions() & | 1008 (source_tab_contents_->content_restrictions() & |
1009 CONTENT_RESTRICTION_SAVE)) { | 1009 content::CONTENT_RESTRICTION_SAVE)) { |
1010 return false; | 1010 return false; |
1011 } | 1011 } |
1012 | 1012 |
1013 // Allow Spell Check language items on sub menu for text area context menu. | 1013 // Allow Spell Check language items on sub menu for text area context menu. |
1014 if ((id >= IDC_SPELLCHECK_LANGUAGES_FIRST) && | 1014 if ((id >= IDC_SPELLCHECK_LANGUAGES_FIRST) && |
1015 (id < IDC_SPELLCHECK_LANGUAGES_LAST)) { | 1015 (id < IDC_SPELLCHECK_LANGUAGES_LAST)) { |
1016 return profile_->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck); | 1016 return profile_->GetPrefs()->GetBoolean(prefs::kEnableSpellCheck); |
1017 } | 1017 } |
1018 | 1018 |
1019 // Custom items. | 1019 // Custom items. |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1897 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1898 g_browser_process->clipboard()); | 1898 g_browser_process->clipboard()); |
1899 } | 1899 } |
1900 | 1900 |
1901 void RenderViewContextMenu::MediaPlayerActionAt( | 1901 void RenderViewContextMenu::MediaPlayerActionAt( |
1902 const gfx::Point& location, | 1902 const gfx::Point& location, |
1903 const WebMediaPlayerAction& action) { | 1903 const WebMediaPlayerAction& action) { |
1904 source_tab_contents_->render_view_host()-> | 1904 source_tab_contents_->render_view_host()-> |
1905 ExecuteMediaPlayerActionAtLocation(location, action); | 1905 ExecuteMediaPlayerActionAtLocation(location, action); |
1906 } | 1906 } |
OLD | NEW |