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 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 } | 2577 } |
2578 | 2578 |
2579 bool WebViewImpl::isSelectionAnchorFirst() const | 2579 bool WebViewImpl::isSelectionAnchorFirst() const |
2580 { | 2580 { |
2581 const Frame* frame = focusedCoreFrame(); | 2581 const Frame* frame = focusedCoreFrame(); |
2582 if (!frame || frame->isRemoteFrame()) | 2582 if (!frame || frame->isRemoteFrame()) |
2583 return false; | 2583 return false; |
2584 return toLocalFrame(frame)->selection().selection().isBaseFirst(); | 2584 return toLocalFrame(frame)->selection().selection().isBaseFirst(); |
2585 } | 2585 } |
2586 | 2586 |
2587 WebVector<WebCompositionUnderline> WebViewImpl::compositionUnderlines() const | |
2588 { | |
2589 const LocalFrame* focused = toLocalFrame(focusedCoreFrame()); | |
2590 if (!focused) | |
2591 return WebVector<WebCompositionUnderline>(); | |
2592 const Vector<CompositionUnderline>& underlines = focused->inputMethodControl
ler().customCompositionUnderlines(); | |
2593 WebVector<WebCompositionUnderline> results(underlines.size()); | |
2594 for (size_t index = 0; index < underlines.size(); ++index) { | |
2595 CompositionUnderline underline = underlines[index]; | |
2596 results[index] = WebCompositionUnderline(underline.startOffset, underlin
e.endOffset, static_cast<WebColor>(underline.color.rgb()), underline.thick, stat
ic_cast<WebColor>(underline.backgroundColor.rgb())); | |
2597 } | |
2598 return results; | |
2599 } | |
2600 | |
2601 WebColor WebViewImpl::backgroundColor() const | 2587 WebColor WebViewImpl::backgroundColor() const |
2602 { | 2588 { |
2603 if (isTransparent()) | 2589 if (isTransparent()) |
2604 return Color::transparent; | 2590 return Color::transparent; |
2605 if (!m_page) | 2591 if (!m_page) |
2606 return m_baseBackgroundColor; | 2592 return m_baseBackgroundColor; |
2607 if (!m_page->mainFrame()) | 2593 if (!m_page->mainFrame()) |
2608 return m_baseBackgroundColor; | 2594 return m_baseBackgroundColor; |
2609 if (!m_page->mainFrame()->isLocalFrame()) | 2595 if (!m_page->mainFrame()->isLocalFrame()) |
2610 return m_baseBackgroundColor; | 2596 return m_baseBackgroundColor; |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4416 if (m_pageColorOverlay) | 4402 if (m_pageColorOverlay) |
4417 m_pageColorOverlay->update(); | 4403 m_pageColorOverlay->update(); |
4418 if (m_inspectorOverlay) { | 4404 if (m_inspectorOverlay) { |
4419 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4405 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4420 if (inspectorPageOverlay) | 4406 if (inspectorPageOverlay) |
4421 inspectorPageOverlay->update(); | 4407 inspectorPageOverlay->update(); |
4422 } | 4408 } |
4423 } | 4409 } |
4424 | 4410 |
4425 } // namespace blink | 4411 } // namespace blink |
OLD | NEW |