| 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 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 focused->selection().rootEditableElementOrDocumentElement(); | 2332 focused->selection().rootEditableElementOrDocumentElement(); |
| 2333 DCHECK(editable); | 2333 DCHECK(editable); |
| 2334 | 2334 |
| 2335 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets | 2335 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets |
| 2336 // needs to be audited. See http://crbug.com/590369 for more details. | 2336 // needs to be audited. See http://crbug.com/590369 for more details. |
| 2337 editable->document().updateStyleAndLayoutIgnorePendingStylesheets(); | 2337 editable->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 2338 | 2338 |
| 2339 return PlainTextRange::create(*editable, range); | 2339 return PlainTextRange::create(*editable, range); |
| 2340 } | 2340 } |
| 2341 | 2341 |
| 2342 WebTextInputInfo WebViewImpl::textInputInfo() { | |
| 2343 LocalFrame* focused = focusedLocalFrameInWidget(); | |
| 2344 if (!focused) | |
| 2345 return WebTextInputInfo(); | |
| 2346 return focused->inputMethodController().textInputInfo(); | |
| 2347 } | |
| 2348 | |
| 2349 WebTextInputType WebViewImpl::textInputType() { | |
| 2350 LocalFrame* focused = focusedLocalFrameInWidget(); | |
| 2351 if (!focused) | |
| 2352 return WebTextInputTypeNone; | |
| 2353 return focused->inputMethodController().textInputType(); | |
| 2354 } | |
| 2355 | |
| 2356 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as | 2342 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as |
| 2357 // well. This code needs to be refactored (http://crbug.com/629721). | 2343 // well. This code needs to be refactored (http://crbug.com/629721). |
| 2358 bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const { | 2344 bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const { |
| 2359 const Frame* frame = focusedCoreFrame(); | 2345 const Frame* frame = focusedCoreFrame(); |
| 2360 if (!frame || !frame->isLocalFrame()) | 2346 if (!frame || !frame->isLocalFrame()) |
| 2361 return false; | 2347 return false; |
| 2362 | 2348 |
| 2363 const LocalFrame* localFrame = toLocalFrame(frame); | 2349 const LocalFrame* localFrame = toLocalFrame(frame); |
| 2364 if (!localFrame) | 2350 if (!localFrame) |
| 2365 return false; | 2351 return false; |
| (...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3576 if (m_layerTreeView) | 3562 if (m_layerTreeView) |
| 3577 m_layerTreeView->setHasTransparentBackground(this->isTransparent()); | 3563 m_layerTreeView->setHasTransparentBackground(this->isTransparent()); |
| 3578 } | 3564 } |
| 3579 | 3565 |
| 3580 bool WebViewImpl::isTransparent() const { | 3566 bool WebViewImpl::isTransparent() const { |
| 3581 return m_isTransparent; | 3567 return m_isTransparent; |
| 3582 } | 3568 } |
| 3583 | 3569 |
| 3584 WebInputMethodControllerImpl* WebViewImpl::getActiveWebInputMethodController() | 3570 WebInputMethodControllerImpl* WebViewImpl::getActiveWebInputMethodController() |
| 3585 const { | 3571 const { |
| 3586 return WebInputMethodControllerImpl::fromFrame( | 3572 return WebInputMethodControllerImpl::fromFrame(focusedLocalFrameInWidget()); |
| 3587 focusedLocalFrameAvailableForIme()); | |
| 3588 } | 3573 } |
| 3589 | 3574 |
| 3590 void WebViewImpl::setBaseBackgroundColor(WebColor color) { | 3575 void WebViewImpl::setBaseBackgroundColor(WebColor color) { |
| 3591 if (m_baseBackgroundColor == color) | 3576 if (m_baseBackgroundColor == color) |
| 3592 return; | 3577 return; |
| 3593 | 3578 |
| 3594 m_baseBackgroundColor = color; | 3579 m_baseBackgroundColor = color; |
| 3595 | 3580 |
| 3596 if (m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()) | 3581 if (m_page->mainFrame() && m_page->mainFrame()->isLocalFrame()) |
| 3597 m_page->deprecatedLocalMainFrame()->view()->setBaseBackgroundColor(color); | 3582 m_page->deprecatedLocalMainFrame()->view()->setBaseBackgroundColor(color); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4202 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4187 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4203 return nullptr; | 4188 return nullptr; |
| 4204 return focusedFrame; | 4189 return focusedFrame; |
| 4205 } | 4190 } |
| 4206 | 4191 |
| 4207 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4192 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4208 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4193 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4209 } | 4194 } |
| 4210 | 4195 |
| 4211 } // namespace blink | 4196 } // namespace blink |
| OLD | NEW |