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

Side by Side Diff: content/renderer/render_widget.cc

Issue 2306643003: WebRange-ify WebWidget::compositionRange. (Closed)
Patch Set: Created 4 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
OLDNEW
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1871 convertViewportToWindow(&bounds_from_blink[i]); 1871 convertViewportToWindow(&bounds_from_blink[i]);
1872 bounds->push_back(bounds_from_blink[i]); 1872 bounds->push_back(bounds_from_blink[i]);
1873 } 1873 }
1874 } 1874 }
1875 1875
1876 void RenderWidget::GetCompositionRange(gfx::Range* range) { 1876 void RenderWidget::GetCompositionRange(gfx::Range* range) {
1877 #if defined(ENABLE_PLUGINS) 1877 #if defined(ENABLE_PLUGINS)
1878 if (focused_pepper_plugin_) 1878 if (focused_pepper_plugin_)
1879 return; 1879 return;
1880 #endif 1880 #endif
1881 size_t location, length; 1881 WebRange web_range = webwidget_->compositionRange();
1882 if (webwidget_->compositionRange(&location, &length)) { 1882 if (!web_range.isNull()) {
1883 range->set_start(location); 1883 range->set_start(web_range.startOffset());
1884 range->set_end(location + length); 1884 range->set_end(web_range.endOffset());
1885 } else { 1885 } else {
1886 WebRange web_range = webwidget_->caretOrSelectionRange(); 1886 web_range = webwidget_->caretOrSelectionRange();
1887 range->set_start(web_range.startOffset()); 1887 range->set_start(web_range.startOffset());
1888 range->set_end(web_range.endOffset()); 1888 range->set_end(web_range.endOffset());
1889 } 1889 }
1890 } 1890 }
1891 1891
1892 bool RenderWidget::ShouldUpdateCompositionInfo( 1892 bool RenderWidget::ShouldUpdateCompositionInfo(
1893 const gfx::Range& range, 1893 const gfx::Range& range,
1894 const std::vector<gfx::Rect>& bounds) { 1894 const std::vector<gfx::Rect>& bounds) {
1895 if (composition_range_ != range) 1895 if (composition_range_ != range)
1896 return true; 1896 return true;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 void RenderWidget::requestPointerUnlock() { 2087 void RenderWidget::requestPointerUnlock() {
2088 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get()); 2088 mouse_lock_dispatcher_->UnlockMouse(webwidget_mouse_lock_target_.get());
2089 } 2089 }
2090 2090
2091 bool RenderWidget::isPointerLocked() { 2091 bool RenderWidget::isPointerLocked() {
2092 return mouse_lock_dispatcher_->IsMouseLockedTo( 2092 return mouse_lock_dispatcher_->IsMouseLockedTo(
2093 webwidget_mouse_lock_target_.get()); 2093 webwidget_mouse_lock_target_.get());
2094 } 2094 }
2095 2095
2096 } // namespace content 2096 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebFrameWidgetImpl.h » ('j') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698