| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 return frame()->localDOMWindow()->pendingUnloadEventListeners(); | 936 return frame()->localDOMWindow()->pendingUnloadEventListeners(); |
| 937 } | 937 } |
| 938 | 938 |
| 939 void WebLocalFrameImpl::replaceSelection(const WebString& text) | 939 void WebLocalFrameImpl::replaceSelection(const WebString& text) |
| 940 { | 940 { |
| 941 bool selectReplacement = frame()->editor().behavior().shouldSelectReplacemen
t(); | 941 bool selectReplacement = frame()->editor().behavior().shouldSelectReplacemen
t(); |
| 942 bool smartReplace = true; | 942 bool smartReplace = true; |
| 943 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep
lace); | 943 frame()->editor().replaceSelectionWithText(text, selectReplacement, smartRep
lace); |
| 944 } | 944 } |
| 945 | 945 |
| 946 void WebLocalFrameImpl::insertText(const WebString& text) | |
| 947 { | |
| 948 if (frame()->inputMethodController().hasComposition()) { | |
| 949 // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesh
eets | |
| 950 // needs to be audited. See http://crbug.com/590369 for more details. | |
| 951 frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets(); | |
| 952 | |
| 953 frame()->inputMethodController().confirmComposition(text); | |
| 954 } else { | |
| 955 frame()->editor().insertText(text, 0); | |
| 956 } | |
| 957 } | |
| 958 | |
| 959 void WebLocalFrameImpl::setMarkedText(const WebString& text, unsigned location,
unsigned length) | 946 void WebLocalFrameImpl::setMarkedText(const WebString& text, unsigned location,
unsigned length) |
| 960 { | 947 { |
| 961 Vector<CompositionUnderline> decorations; | 948 Vector<CompositionUnderline> decorations; |
| 962 frame()->inputMethodController().setComposition(text, decorations, location,
length); | 949 frame()->inputMethodController().setComposition(text, decorations, location,
length); |
| 963 } | 950 } |
| 964 | 951 |
| 965 void WebLocalFrameImpl::unmarkText() | 952 void WebLocalFrameImpl::unmarkText() |
| 966 { | 953 { |
| 967 frame()->inputMethodController().cancelComposition(); | 954 frame()->inputMethodController().cancelComposition(); |
| 968 } | 955 } |
| (...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2222 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; | 2209 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; |
| 2223 } else if (metric == "wasAlternateProtocolAvailable") { | 2210 } else if (metric == "wasAlternateProtocolAvailable") { |
| 2224 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; | 2211 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; |
| 2225 } else if (metric == "connectionInfo") { | 2212 } else if (metric == "connectionInfo") { |
| 2226 feature = UseCounter::ChromeLoadTimesConnectionInfo; | 2213 feature = UseCounter::ChromeLoadTimesConnectionInfo; |
| 2227 } | 2214 } |
| 2228 UseCounter::count(frame(), feature); | 2215 UseCounter::count(frame(), feature); |
| 2229 } | 2216 } |
| 2230 | 2217 |
| 2231 } // namespace blink | 2218 } // namespace blink |
| OLD | NEW |