| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/tab_contents/render_view_context_menu.h" | 5 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 #include "content/public/common/ssl_status.h" | 82 #include "content/public/common/ssl_status.h" |
| 83 #include "content/public/common/url_utils.h" | 83 #include "content/public/common/url_utils.h" |
| 84 #include "extensions/browser/view_type_utils.h" | 84 #include "extensions/browser/view_type_utils.h" |
| 85 #include "grit/generated_resources.h" | 85 #include "grit/generated_resources.h" |
| 86 #include "net/base/escape.h" | 86 #include "net/base/escape.h" |
| 87 #include "third_party/WebKit/public/web/WebContextMenuData.h" | 87 #include "third_party/WebKit/public/web/WebContextMenuData.h" |
| 88 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h" | 88 #include "third_party/WebKit/public/web/WebMediaPlayerAction.h" |
| 89 #include "third_party/WebKit/public/web/WebPluginAction.h" | 89 #include "third_party/WebKit/public/web/WebPluginAction.h" |
| 90 #include "ui/base/clipboard/clipboard.h" | 90 #include "ui/base/clipboard/clipboard.h" |
| 91 #include "ui/base/l10n/l10n_util.h" | 91 #include "ui/base/l10n/l10n_util.h" |
| 92 #include "ui/base/text/text_elider.h" | |
| 93 #include "ui/gfx/favicon_size.h" | 92 #include "ui/gfx/favicon_size.h" |
| 94 #include "ui/gfx/point.h" | 93 #include "ui/gfx/point.h" |
| 95 #include "ui/gfx/size.h" | 94 #include "ui/gfx/size.h" |
| 95 #include "ui/gfx/text_elider.h" |
| 96 | 96 |
| 97 #if defined(ENABLE_PRINTING) | 97 #if defined(ENABLE_PRINTING) |
| 98 #include "chrome/common/print_messages.h" | 98 #include "chrome/common/print_messages.h" |
| 99 | 99 |
| 100 #if defined(ENABLE_FULL_PRINTING) | 100 #if defined(ENABLE_FULL_PRINTING) |
| 101 #include "chrome/browser/printing/print_preview_context_menu_observer.h" | 101 #include "chrome/browser/printing/print_preview_context_menu_observer.h" |
| 102 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 102 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
| 103 #include "chrome/browser/printing/print_view_manager.h" | 103 #include "chrome/browser/printing/print_view_manager.h" |
| 104 #else | 104 #else |
| 105 #include "chrome/browser/printing/print_view_manager_basic.h" | 105 #include "chrome/browser/printing/print_view_manager_basic.h" |
| (...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2025 // Don't enable the web inspector if the developer tools are disabled via | 2025 // Don't enable the web inspector if the developer tools are disabled via |
| 2026 // the preference dev-tools-disabled. | 2026 // the preference dev-tools-disabled. |
| 2027 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 2027 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
| 2028 return false; | 2028 return false; |
| 2029 } | 2029 } |
| 2030 | 2030 |
| 2031 return true; | 2031 return true; |
| 2032 } | 2032 } |
| 2033 | 2033 |
| 2034 string16 RenderViewContextMenu::PrintableSelectionText() { | 2034 string16 RenderViewContextMenu::PrintableSelectionText() { |
| 2035 return ui::TruncateString(params_.selection_text, | 2035 return gfx::TruncateString(params_.selection_text, |
| 2036 kMaxSelectionTextLength); | 2036 kMaxSelectionTextLength); |
| 2037 } | 2037 } |
| 2038 | 2038 |
| 2039 // Controller functions -------------------------------------------------------- | 2039 // Controller functions -------------------------------------------------------- |
| 2040 | 2040 |
| 2041 void RenderViewContextMenu::OpenURL( | 2041 void RenderViewContextMenu::OpenURL( |
| 2042 const GURL& url, const GURL& referrer, int64 frame_id, | 2042 const GURL& url, const GURL& referrer, int64 frame_id, |
| 2043 WindowOpenDisposition disposition, | 2043 WindowOpenDisposition disposition, |
| 2044 content::PageTransition transition) { | 2044 content::PageTransition transition) { |
| 2045 // Ensure that URL fragment, username and password fields are not sent | 2045 // Ensure that URL fragment, username and password fields are not sent |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2105 source_web_contents_->GetRenderViewHost()-> | 2105 source_web_contents_->GetRenderViewHost()-> |
| 2106 ExecuteMediaPlayerActionAtLocation(location, action); | 2106 ExecuteMediaPlayerActionAtLocation(location, action); |
| 2107 } | 2107 } |
| 2108 | 2108 |
| 2109 void RenderViewContextMenu::PluginActionAt( | 2109 void RenderViewContextMenu::PluginActionAt( |
| 2110 const gfx::Point& location, | 2110 const gfx::Point& location, |
| 2111 const WebPluginAction& action) { | 2111 const WebPluginAction& action) { |
| 2112 source_web_contents_->GetRenderViewHost()-> | 2112 source_web_contents_->GetRenderViewHost()-> |
| 2113 ExecutePluginActionAtLocation(location, action); | 2113 ExecutePluginActionAtLocation(location, action); |
| 2114 } | 2114 } |
| OLD | NEW |