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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 2132633002: Tracking composition range on the browser side (Aura) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting Fixes Created 4 years, 5 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/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 display::Screen::GetScreen()->GetDisplayNearestWindow(window_); 969 display::Screen::GetScreen()->GetDisplayNearestWindow(window_);
970 current_cursor_.SetDisplayInfo(display); 970 current_cursor_.SetDisplayInfo(display);
971 UpdateCursorIfOverSelf(); 971 UpdateCursorIfOverSelf();
972 } 972 }
973 973
974 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) { 974 void RenderWidgetHostViewAura::SetIsLoading(bool is_loading) {
975 is_loading_ = is_loading; 975 is_loading_ = is_loading;
976 UpdateCursorIfOverSelf(); 976 UpdateCursorIfOverSelf();
977 } 977 }
978 978
979 void RenderWidgetHostViewAura::ImeCompositionRangeChanged(
980 const gfx::Range& range,
981 const std::vector<gfx::Rect>& character_bounds) {
982 composition_character_bounds_ = character_bounds;
983 }
984
985 void RenderWidgetHostViewAura::RenderProcessGone(base::TerminationStatus status, 979 void RenderWidgetHostViewAura::RenderProcessGone(base::TerminationStatus status,
986 int error_code) { 980 int error_code) {
987 UpdateCursorIfOverSelf(); 981 UpdateCursorIfOverSelf();
988 Destroy(); 982 Destroy();
989 } 983 }
990 984
991 void RenderWidgetHostViewAura::Destroy() { 985 void RenderWidgetHostViewAura::Destroy() {
992 // Beware, this function is not called on all destruction paths. If |window_| 986 // Beware, this function is not called on all destruction paths. If |window_|
993 // has been created, then it will implicitly end up calling 987 // has been created, then it will implicitly end up calling
994 // ~RenderWidgetHostViewAura when |window_| is destroyed. Otherwise, The 988 // ~RenderWidgetHostViewAura when |window_| is destroyed. Otherwise, The
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const { 1520 gfx::Rect RenderWidgetHostViewAura::GetCaretBounds() const {
1527 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget()) 1521 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget())
1528 return gfx::Rect(); 1522 return gfx::Rect();
1529 return ConvertRectToScreen(text_input_manager_->GetSelectionBoundsRect()); 1523 return ConvertRectToScreen(text_input_manager_->GetSelectionBoundsRect());
1530 } 1524 }
1531 1525
1532 bool RenderWidgetHostViewAura::GetCompositionCharacterBounds( 1526 bool RenderWidgetHostViewAura::GetCompositionCharacterBounds(
1533 uint32_t index, 1527 uint32_t index,
1534 gfx::Rect* rect) const { 1528 gfx::Rect* rect) const {
1535 DCHECK(rect); 1529 DCHECK(rect);
1536 if (index >= composition_character_bounds_.size()) 1530
1531 if (!text_input_manager_ || !text_input_manager_->GetActiveWidget())
1537 return false; 1532 return false;
1538 *rect = ConvertRectToScreen(composition_character_bounds_[index]); 1533
1534 const std::vector<gfx::Rect>* composition_character_bounds =
1535 text_input_manager_->GetCompositionCharacterBounds();
1536 if (index >= composition_character_bounds->size())
1537 return false;
1538 *rect = ConvertRectToScreen(composition_character_bounds->at(index));
1539 return true; 1539 return true;
1540 } 1540 }
1541 1541
1542 bool RenderWidgetHostViewAura::HasCompositionText() const { 1542 bool RenderWidgetHostViewAura::HasCompositionText() const {
1543 return has_composition_text_; 1543 return has_composition_text_;
1544 } 1544 }
1545 1545
1546 bool RenderWidgetHostViewAura::GetTextRange(gfx::Range* range) const { 1546 bool RenderWidgetHostViewAura::GetTextRange(gfx::Range* range) const {
1547 range->set_start(selection_text_offset_); 1547 range->set_start(selection_text_offset_);
1548 range->set_end(selection_text_offset_ + selection_text_.length()); 1548 range->set_end(selection_text_offset_ + selection_text_.length());
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 3001
3002 //////////////////////////////////////////////////////////////////////////////// 3002 ////////////////////////////////////////////////////////////////////////////////
3003 // RenderWidgetHostViewBase, public: 3003 // RenderWidgetHostViewBase, public:
3004 3004
3005 // static 3005 // static
3006 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 3006 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
3007 GetScreenInfoForWindow(results, NULL); 3007 GetScreenInfoForWindow(results, NULL);
3008 } 3008 }
3009 3009
3010 } // namespace content 3010 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698