| OLD | NEW |
| 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 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2446 return BaseBackgroundColor().Rgb(); | 2446 return BaseBackgroundColor().Rgb(); |
| 2447 return view->DocumentBackgroundColor().Rgb(); | 2447 return view->DocumentBackgroundColor().Rgb(); |
| 2448 } | 2448 } |
| 2449 | 2449 |
| 2450 WebPagePopupImpl* WebViewImpl::GetPagePopup() const { | 2450 WebPagePopupImpl* WebViewImpl::GetPagePopup() const { |
| 2451 return page_popup_.Get(); | 2451 return page_popup_.Get(); |
| 2452 } | 2452 } |
| 2453 | 2453 |
| 2454 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as | 2454 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as |
| 2455 // well. This code needs to be refactored (http://crbug.com/629721). | 2455 // well. This code needs to be refactored (http://crbug.com/629721). |
| 2456 WebRange WebViewImpl::CaretOrSelectionRange() { | |
| 2457 const LocalFrame* focused = FocusedLocalFrameInWidget(); | |
| 2458 if (!focused) | |
| 2459 return WebRange(); | |
| 2460 | |
| 2461 // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets | |
| 2462 // needs to be audited. See http://crbug.com/590369 for more details. | |
| 2463 focused->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); | |
| 2464 | |
| 2465 return focused->GetInputMethodController().GetSelectionOffsets(); | |
| 2466 } | |
| 2467 | |
| 2468 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as | |
| 2469 // well. This code needs to be refactored (http://crbug.com/629721). | |
| 2470 void WebViewImpl::SetTextDirection(WebTextDirection direction) { | 2456 void WebViewImpl::SetTextDirection(WebTextDirection direction) { |
| 2471 // The Editor::setBaseWritingDirection() function checks if we can change | 2457 // The Editor::setBaseWritingDirection() function checks if we can change |
| 2472 // the text direction of the selected node and updates its DOM "dir" | 2458 // the text direction of the selected node and updates its DOM "dir" |
| 2473 // attribute and its CSS "direction" property. | 2459 // attribute and its CSS "direction" property. |
| 2474 // So, we just call the function as Safari does. | 2460 // So, we just call the function as Safari does. |
| 2475 const LocalFrame* focused = FocusedLocalFrameInWidget(); | 2461 const LocalFrame* focused = FocusedLocalFrameInWidget(); |
| 2476 if (!focused) | 2462 if (!focused) |
| 2477 return; | 2463 return; |
| 2478 | 2464 |
| 2479 Editor& editor = focused->GetEditor(); | 2465 Editor& editor = focused->GetEditor(); |
| (...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4120 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) | 4106 if (focused_frame->LocalFrameRoot() != MainFrameImpl()->GetFrame()) |
| 4121 return nullptr; | 4107 return nullptr; |
| 4122 return focused_frame; | 4108 return focused_frame; |
| 4123 } | 4109 } |
| 4124 | 4110 |
| 4125 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { | 4111 LocalFrame* WebViewImpl::FocusedLocalFrameAvailableForIme() const { |
| 4126 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; | 4112 return ime_accept_events_ ? FocusedLocalFrameInWidget() : nullptr; |
| 4127 } | 4113 } |
| 4128 | 4114 |
| 4129 } // namespace blink | 4115 } // namespace blink |
| OLD | NEW |