| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/public/browser/web_contents_delegate.h" | 5 #include "content/public/browser/web_contents_delegate.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const content::ContextMenuParams& params) { | 89 const content::ContextMenuParams& params) { |
| 90 return false; | 90 return false; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void WebContentsDelegate::ViewSourceForTab(WebContents* source, | 93 void WebContentsDelegate::ViewSourceForTab(WebContents* source, |
| 94 const GURL& page_url) { | 94 const GURL& page_url) { |
| 95 // Fall back implementation based entirely on the view-source scheme. | 95 // Fall back implementation based entirely on the view-source scheme. |
| 96 // It suffers from http://crbug.com/523 and that is why browser overrides | 96 // It suffers from http://crbug.com/523 and that is why browser overrides |
| 97 // it with proper implementation. | 97 // it with proper implementation. |
| 98 GURL url = GURL(kViewSourceScheme + std::string(":") + page_url.spec()); | 98 GURL url = GURL(kViewSourceScheme + std::string(":") + page_url.spec()); |
| 99 OpenURLFromTab(source, OpenURLParams(url, Referrer(), | 99 OpenURLFromTab( |
| 100 NEW_FOREGROUND_TAB, | 100 source, |
| 101 ui::PAGE_TRANSITION_LINK, false)); | 101 OpenURLParams(url, Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 102 ui::PAGE_TRANSITION_LINK, false)); |
| 102 } | 103 } |
| 103 | 104 |
| 104 void WebContentsDelegate::ViewSourceForFrame(WebContents* source, | 105 void WebContentsDelegate::ViewSourceForFrame(WebContents* source, |
| 105 const GURL& frame_url, | 106 const GURL& frame_url, |
| 106 const PageState& page_state) { | 107 const PageState& page_state) { |
| 107 // Same as ViewSourceForTab, but for given subframe. | 108 // Same as ViewSourceForTab, but for given subframe. |
| 108 GURL url = GURL(kViewSourceScheme + std::string(":") + frame_url.spec()); | 109 GURL url = GURL(kViewSourceScheme + std::string(":") + frame_url.spec()); |
| 109 OpenURLFromTab(source, OpenURLParams(url, Referrer(), | 110 OpenURLFromTab( |
| 110 NEW_FOREGROUND_TAB, | 111 source, |
| 111 ui::PAGE_TRANSITION_LINK, false)); | 112 OpenURLParams(url, Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 113 ui::PAGE_TRANSITION_LINK, false)); |
| 112 } | 114 } |
| 113 | 115 |
| 114 bool WebContentsDelegate::PreHandleKeyboardEvent( | 116 bool WebContentsDelegate::PreHandleKeyboardEvent( |
| 115 WebContents* source, | 117 WebContents* source, |
| 116 const NativeWebKeyboardEvent& event, | 118 const NativeWebKeyboardEvent& event, |
| 117 bool* is_keyboard_shortcut) { | 119 bool* is_keyboard_shortcut) { |
| 118 return false; | 120 return false; |
| 119 } | 121 } |
| 120 | 122 |
| 121 bool WebContentsDelegate::PreHandleGestureEvent( | 123 bool WebContentsDelegate::PreHandleGestureEvent( |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 void WebContentsDelegate::ShowCertificateViewerInDevTools( | 257 void WebContentsDelegate::ShowCertificateViewerInDevTools( |
| 256 WebContents* web_contents, | 258 WebContents* web_contents, |
| 257 int cert_id) { | 259 int cert_id) { |
| 258 } | 260 } |
| 259 | 261 |
| 260 void WebContentsDelegate::RequestAppBannerFromDevTools( | 262 void WebContentsDelegate::RequestAppBannerFromDevTools( |
| 261 content::WebContents* web_contents) { | 263 content::WebContents* web_contents) { |
| 262 } | 264 } |
| 263 | 265 |
| 264 } // namespace content | 266 } // namespace content |
| OLD | NEW |