Chromium Code Reviews| 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 "chrome/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 #include "v8/include/v8-testing.h" | 49 #include "v8/include/v8-testing.h" |
| 50 #include "webkit/glue/image_decoder.h" | 50 #include "webkit/glue/image_decoder.h" |
| 51 #include "webkit/glue/multi_resolution_image_resource_fetcher.h" | 51 #include "webkit/glue/multi_resolution_image_resource_fetcher.h" |
| 52 #include "webkit/glue/webkit_glue.h" | 52 #include "webkit/glue/webkit_glue.h" |
| 53 | 53 |
| 54 using WebKit::WebAccessibilityObject; | 54 using WebKit::WebAccessibilityObject; |
| 55 using WebKit::WebCString; | 55 using WebKit::WebCString; |
| 56 using WebKit::WebDataSource; | 56 using WebKit::WebDataSource; |
| 57 using WebKit::WebDocument; | 57 using WebKit::WebDocument; |
| 58 using WebKit::WebFrame; | 58 using WebKit::WebFrame; |
| 59 using WebKit::WebGestureEvent; | |
| 59 using WebKit::WebIconURL; | 60 using WebKit::WebIconURL; |
| 60 using WebKit::WebRect; | 61 using WebKit::WebRect; |
| 61 using WebKit::WebSecurityOrigin; | 62 using WebKit::WebSecurityOrigin; |
| 62 using WebKit::WebSize; | 63 using WebKit::WebSize; |
| 63 using WebKit::WebString; | 64 using WebKit::WebString; |
| 64 using WebKit::WebTouchEvent; | 65 using WebKit::WebTouchEvent; |
| 65 using WebKit::WebURL; | 66 using WebKit::WebURL; |
| 66 using WebKit::WebURLRequest; | 67 using WebKit::WebURLRequest; |
| 67 using WebKit::WebView; | 68 using WebKit::WebView; |
| 68 using WebKit::WebVector; | 69 using WebKit::WebVector; |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 683 return; | 684 return; |
| 684 const WebKit::WebTouchPoint point = event.touches[0]; | 685 const WebKit::WebTouchPoint point = event.touches[0]; |
| 685 accessibility = accessibility.hitTest(point.position); | 686 accessibility = accessibility.hitTest(point.position); |
| 686 if (accessibility.isNull()) | 687 if (accessibility.isNull()) |
| 687 return; | 688 return; |
| 688 if (accessibility.node() == node) | 689 if (accessibility.node() == node) |
| 689 render_view()->Send(new ChromeViewHostMsg_FocusedEditableNodeTouched( | 690 render_view()->Send(new ChromeViewHostMsg_FocusedEditableNodeTouched( |
| 690 render_view()->GetRoutingID())); | 691 render_view()->GetRoutingID())); |
| 691 } | 692 } |
| 692 | 693 |
| 694 void ChromeRenderViewObserver::DidHandleGestureEvent( | |
| 695 const WebGestureEvent& event) { | |
| 696 if (event.type != WebKit::WebGestureEvent::GestureTap) | |
| 697 return; | |
| 698 | |
| 699 if (render_view()->GetWebView()->textInputType() != | |
| 700 WebKit::WebTextInputTypeNone) { | |
| 701 render_view()->Send(new ChromeViewHostMsg_FocusedEditableNodeTouched( | |
| 702 render_view()->GetRoutingID())); | |
|
jam
2012/12/17 22:51:09
nit: indent. also here and above, you can just do
ananta
2012/12/17 22:59:06
Fixed this. The ChromeRenderViewObserver::DidHandl
| |
| 703 } | |
| 704 } | |
| 705 | |
| 693 void ChromeRenderViewObserver::CapturePageInfoLater(bool preliminary_capture, | 706 void ChromeRenderViewObserver::CapturePageInfoLater(bool preliminary_capture, |
| 694 base::TimeDelta delay) { | 707 base::TimeDelta delay) { |
| 695 capture_timer_.Start( | 708 capture_timer_.Start( |
| 696 FROM_HERE, | 709 FROM_HERE, |
| 697 delay, | 710 delay, |
| 698 base::Bind(&ChromeRenderViewObserver::CapturePageInfo, | 711 base::Bind(&ChromeRenderViewObserver::CapturePageInfo, |
| 699 base::Unretained(this), | 712 base::Unretained(this), |
| 700 preliminary_capture)); | 713 preliminary_capture)); |
| 701 } | 714 } |
| 702 | 715 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 843 if (!external_host_bindings_.get()) { | 856 if (!external_host_bindings_.get()) { |
| 844 external_host_bindings_.reset(new ExternalHostBindings( | 857 external_host_bindings_.reset(new ExternalHostBindings( |
| 845 render_view(), routing_id())); | 858 render_view(), routing_id())); |
| 846 } | 859 } |
| 847 return external_host_bindings_.get(); | 860 return external_host_bindings_.get(); |
| 848 } | 861 } |
| 849 | 862 |
| 850 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 863 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
| 851 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 864 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
| 852 } | 865 } |
| OLD | NEW |