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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2910223003: [refactor] - Rename and Move WebWidget::CaretOrSelectionRange to WebInputMethodController::GetSelec… (Closed)
Patch Set: Fixed some comments Created 3 years, 6 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2474 return BaseBackgroundColor().Rgb(); 2474 return BaseBackgroundColor().Rgb();
2475 return view->DocumentBackgroundColor().Rgb(); 2475 return view->DocumentBackgroundColor().Rgb();
2476 } 2476 }
2477 2477
2478 WebPagePopupImpl* WebViewImpl::GetPagePopup() const { 2478 WebPagePopupImpl* WebViewImpl::GetPagePopup() const {
2479 return page_popup_.Get(); 2479 return page_popup_.Get();
2480 } 2480 }
2481 2481
2482 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as 2482 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2483 // well. This code needs to be refactored (http://crbug.com/629721). 2483 // well. This code needs to be refactored (http://crbug.com/629721).
2484 WebRange WebViewImpl::CaretOrSelectionRange() {
2485 const LocalFrame* focused = FocusedLocalFrameInWidget();
2486 if (!focused)
2487 return WebRange();
2488
2489 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
2490 // needs to be audited. See http://crbug.com/590369 for more details.
2491 focused->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
2492
2493 return focused->GetInputMethodController().GetSelectionOffsets();
2494 }
2495
2496 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2497 // well. This code needs to be refactored (http://crbug.com/629721).
2498 void WebViewImpl::SetTextDirection(WebTextDirection direction) { 2484 void WebViewImpl::SetTextDirection(WebTextDirection direction) {
2499 // The Editor::setBaseWritingDirection() function checks if we can change 2485 // The Editor::setBaseWritingDirection() function checks if we can change
2500 // the text direction of the selected node and updates its DOM "dir" 2486 // the text direction of the selected node and updates its DOM "dir"
2501 // attribute and its CSS "direction" property. 2487 // attribute and its CSS "direction" property.
2502 // So, we just call the function as Safari does. 2488 // So, we just call the function as Safari does.
2503 const LocalFrame* focused = FocusedLocalFrameInWidget(); 2489 const LocalFrame* focused = FocusedLocalFrameInWidget();
2504 if (!focused) 2490 if (!focused)
2505 return; 2491 return;
2506 2492
2507 Editor& editor = focused->GetEditor(); 2493 Editor& editor = focused->GetEditor();
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) 4134 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame())
4149 return nullptr; 4135 return nullptr;
4150 return focused_frame; 4136 return focused_frame;
4151 } 4137 }
4152 4138
4153 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { 4139 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const {
4154 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; 4140 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr;
4155 } 4141 }
4156 4142
4157 } // namespace blink 4143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698