| 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 "ui/web_dialogs/web_dialog_web_contents_delegate.h" | 5 #include "ui/web_dialogs/web_dialog_web_contents_delegate.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 9 #include "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 initial_pos, user_gesture); | 49 initial_pos, user_gesture); |
| 50 } | 50 } |
| 51 | 51 |
| 52 bool WebDialogWebContentsDelegate::IsPopupOrPanel( | 52 bool WebDialogWebContentsDelegate::IsPopupOrPanel( |
| 53 const WebContents* source) const { | 53 const WebContents* source) const { |
| 54 // This needs to return true so that we are allowed to be resized by our | 54 // This needs to return true so that we are allowed to be resized by our |
| 55 // contents. | 55 // contents. |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void WebDialogWebContentsDelegate::WebContentsFocused(WebContents* contents) { |
| 60 contents->Focus(); |
| 61 } |
| 62 |
| 59 bool WebDialogWebContentsDelegate::PreHandleGestureEvent( | 63 bool WebDialogWebContentsDelegate::PreHandleGestureEvent( |
| 60 WebContents* source, | 64 WebContents* source, |
| 61 const blink::WebGestureEvent& event) { | 65 const blink::WebGestureEvent& event) { |
| 62 // Disable pinch zooming. | 66 // Disable pinch zooming. |
| 63 return event.type == blink::WebGestureEvent::GesturePinchBegin || | 67 return event.type == blink::WebGestureEvent::GesturePinchBegin || |
| 64 event.type == blink::WebGestureEvent::GesturePinchUpdate || | 68 event.type == blink::WebGestureEvent::GesturePinchUpdate || |
| 65 event.type == blink::WebGestureEvent::GesturePinchEnd; | 69 event.type == blink::WebGestureEvent::GesturePinchEnd; |
| 66 } | 70 } |
| 67 | 71 |
| 68 } // namespace ui | 72 } // namespace ui |
| OLD | NEW |