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 "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
12 #include "content/public/common/url_constants.h" | 12 #include "content/public/common/url_constants.h" |
13 #include "content/public/common/bindings_policy.h" | 13 #include "content/public/common/bindings_policy.h" |
14 #include "third_party/WebKit/public/web/WebInputEvent.h" | |
14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 | 18 |
18 WebContentsDelegate::WebContentsDelegate() { | 19 WebContentsDelegate::WebContentsDelegate() { |
19 } | 20 } |
20 | 21 |
21 WebContents* WebContentsDelegate::OpenURLFromTab(WebContents* source, | 22 WebContents* WebContentsDelegate::OpenURLFromTab(WebContents* source, |
22 const OpenURLParams& params) { | 23 const OpenURLParams& params) { |
23 return NULL; | 24 return NULL; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 PAGE_TRANSITION_LINK, false)); | 104 PAGE_TRANSITION_LINK, false)); |
104 } | 105 } |
105 | 106 |
106 bool WebContentsDelegate::PreHandleKeyboardEvent( | 107 bool WebContentsDelegate::PreHandleKeyboardEvent( |
107 WebContents* source, | 108 WebContents* source, |
108 const NativeWebKeyboardEvent& event, | 109 const NativeWebKeyboardEvent& event, |
109 bool* is_keyboard_shortcut) { | 110 bool* is_keyboard_shortcut) { |
110 return false; | 111 return false; |
111 } | 112 } |
112 | 113 |
114 bool WebContentsDelegate::PreHandleGestureEvent( | |
115 WebContents* source, | |
116 const blink::WebGestureEvent& event) { | |
117 // By default, swallow pinch events | |
sadrul
2014/01/13 21:55:19
This is only on desktop, right? So check !defined(
bokan
2014/01/13 22:45:09
Yup. Added. I'm assuming Android doesn't use brows
| |
118 return event.type == blink::WebGestureEvent::GesturePinchBegin || | |
119 event.type == blink::WebGestureEvent::GesturePinchUpdate || | |
120 event.type == blink::WebGestureEvent::GesturePinchEnd; | |
121 } | |
122 | |
113 bool WebContentsDelegate::CanDragEnter( | 123 bool WebContentsDelegate::CanDragEnter( |
114 WebContents* source, | 124 WebContents* source, |
115 const DropData& data, | 125 const DropData& data, |
116 blink::WebDragOperationsMask operations_allowed) { | 126 blink::WebDragOperationsMask operations_allowed) { |
117 return true; | 127 return true; |
118 } | 128 } |
119 | 129 |
120 bool WebContentsDelegate::OnGoToEntryOffset(int offset) { | 130 bool WebContentsDelegate::OnGoToEntryOffset(int offset) { |
121 return true; | 131 return true; |
122 } | 132 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 194 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
185 attached_contents_.erase(web_contents); | 195 attached_contents_.erase(web_contents); |
186 } | 196 } |
187 | 197 |
188 gfx::Size WebContentsDelegate::GetSizeForNewRenderView( | 198 gfx::Size WebContentsDelegate::GetSizeForNewRenderView( |
189 const WebContents* web_contents) const { | 199 const WebContents* web_contents) const { |
190 return gfx::Size(); | 200 return gfx::Size(); |
191 } | 201 } |
192 | 202 |
193 } // namespace content | 203 } // namespace content |
OLD | NEW |