Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: webkit/glue/webview_impl.cc

Issue 196128: Hook up WebViewClient, part 1.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | webkit/tools/test_shell/layout_test_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2007-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2007-2009 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 "config.h" 5 #include "config.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 MSVC_PUSH_WARNING_LEVEL(0); 9 MSVC_PUSH_WARNING_LEVEL(0);
10 #include "CSSStyleSelector.h" 10 #include "CSSStyleSelector.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 using WebKit::WebPoint; 109 using WebKit::WebPoint;
110 using WebKit::WebRect; 110 using WebKit::WebRect;
111 using WebKit::WebSettings; 111 using WebKit::WebSettings;
112 using WebKit::WebSettingsImpl; 112 using WebKit::WebSettingsImpl;
113 using WebKit::WebSize; 113 using WebKit::WebSize;
114 using WebKit::WebString; 114 using WebKit::WebString;
115 using WebKit::WebTextDirection; 115 using WebKit::WebTextDirection;
116 using WebKit::WebTextDirectionDefault; 116 using WebKit::WebTextDirectionDefault;
117 using WebKit::WebTextDirectionLeftToRight; 117 using WebKit::WebTextDirectionLeftToRight;
118 using WebKit::WebTextDirectionRightToLeft; 118 using WebKit::WebTextDirectionRightToLeft;
119 using WebKit::WebURL;
119 120
120 using webkit_glue::ImageResourceFetcher; 121 using webkit_glue::ImageResourceFetcher;
121 122
122 // Change the text zoom level by kTextSizeMultiplierRatio each time the user 123 // Change the text zoom level by kTextSizeMultiplierRatio each time the user
123 // zooms text in or out (ie., change by 20%). The min and max values limit 124 // zooms text in or out (ie., change by 20%). The min and max values limit
124 // text zoom to half and 3x the original text size. These three values match 125 // text zoom to half and 3x the original text size. These three values match
125 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm 126 // those in Apple's port in WebKit/WebKit/WebView/WebView.mm
126 static const double kTextSizeMultiplierRatio = 1.2; 127 static const double kTextSizeMultiplierRatio = 1.2;
127 static const double kMinTextSizeMultiplier = 0.5; 128 static const double kMinTextSizeMultiplier = 0.5;
128 static const double kMaxTextSizeMultiplier = 3.0; 129 static const double kMaxTextSizeMultiplier = 3.0;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 main_frame()->frame()->eventHandler()->mouseMoved( 451 main_frame()->frame()->eventHandler()->mouseMoved(
451 PlatformMouseEventBuilder(main_frame()->frameview(), event)); 452 PlatformMouseEventBuilder(main_frame()->frameview(), event));
452 } 453 }
453 454
454 void WebViewImpl::MouseLeave(const WebMouseEvent& event) { 455 void WebViewImpl::MouseLeave(const WebMouseEvent& event) {
455 // This event gets sent as the main frame is closing. In that case, just 456 // This event gets sent as the main frame is closing. In that case, just
456 // ignore it. 457 // ignore it.
457 if (!main_frame() || !main_frame()->frameview()) 458 if (!main_frame() || !main_frame()->frameview())
458 return; 459 return;
459 460
460 delegate_->UpdateTargetURL(this, GURL()); 461 client()->setMouseOverURL(WebURL());
461 462
462 main_frame()->frame()->eventHandler()->handleMouseMoveEvent( 463 main_frame()->frame()->eventHandler()->handleMouseMoveEvent(
463 PlatformMouseEventBuilder(main_frame()->frameview(), event)); 464 PlatformMouseEventBuilder(main_frame()->frameview(), event));
464 } 465 }
465 466
466 void WebViewImpl::MouseDown(const WebMouseEvent& event) { 467 void WebViewImpl::MouseDown(const WebMouseEvent& event) {
467 if (!main_frame() || !main_frame()->frameview()) 468 if (!main_frame() || !main_frame()->frameview())
468 return; 469 return;
469 470
470 last_mouse_down_point_ = gfx::Point(event.x, event.y); 471 last_mouse_down_point_ = gfx::Point(event.x, event.y);
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 *is_new_navigation = observed_new_navigation_; 1808 *is_new_navigation = observed_new_navigation_;
1808 1809
1809 #ifndef NDEBUG 1810 #ifndef NDEBUG
1810 DCHECK(!observed_new_navigation_ || 1811 DCHECK(!observed_new_navigation_ ||
1811 page_->mainFrame()->loader()->documentLoader() == new_navigation_loader_); 1812 page_->mainFrame()->loader()->documentLoader() == new_navigation_loader_);
1812 new_navigation_loader_ = NULL; 1813 new_navigation_loader_ = NULL;
1813 #endif 1814 #endif
1814 observed_new_navigation_ = false; 1815 observed_new_navigation_ = false;
1815 } 1816 }
1816 1817
1817 void WebViewImpl::StartDragging(WebPoint event_pos, 1818 void WebViewImpl::StartDragging(const WebPoint& event_pos,
1818 const WebDragData& drag_data, 1819 const WebDragData& drag_data,
1819 WebDragOperationsMask mask) { 1820 WebDragOperationsMask mask) {
1820 if (delegate_) { 1821 if (!client())
1821 DCHECK(!doing_drag_and_drop_); 1822 return;
1822 doing_drag_and_drop_ = true; 1823 DCHECK(!doing_drag_and_drop_);
1823 delegate_->StartDragging(this, event_pos, drag_data, mask); 1824 doing_drag_and_drop_ = true;
1824 } 1825 client()->startDragging(event_pos, drag_data, mask);
1825 } 1826 }
1826 1827
1827 void WebViewImpl::OnImageFetchComplete(ImageResourceFetcher* fetcher, 1828 void WebViewImpl::OnImageFetchComplete(ImageResourceFetcher* fetcher,
1828 const SkBitmap& image) { 1829 const SkBitmap& image) {
1829 if (delegate_) { 1830 if (delegate_) {
1830 delegate_->DidDownloadImage(fetcher->id(), fetcher->image_url(), 1831 delegate_->DidDownloadImage(fetcher->id(), fetcher->image_url(),
1831 image.isNull(), image); 1832 image.isNull(), image);
1832 } 1833 }
1833 DeleteImageResourceFetcher(fetcher); 1834 DeleteImageResourceFetcher(fetcher);
1834 } 1835 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1926 hitTestResultAtPoint(doc_point, false); 1927 hitTestResultAtPoint(doc_point, false);
1927 } 1928 }
1928 1929
1929 void WebViewImpl::SetSpellingPanelVisibility(bool is_visible) { 1930 void WebViewImpl::SetSpellingPanelVisibility(bool is_visible) {
1930 spelling_panel_is_visible_ = is_visible; 1931 spelling_panel_is_visible_ = is_visible;
1931 } 1932 }
1932 1933
1933 bool WebViewImpl::GetSpellingPanelVisibility() { 1934 bool WebViewImpl::GetSpellingPanelVisibility() {
1934 return spelling_panel_is_visible_; 1935 return spelling_panel_is_visible_;
1935 } 1936 }
OLDNEW
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | webkit/tools/test_shell/layout_test_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698