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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; | 2204 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; |
2218 } else if (metric == "wasAlternateProtocolAvailable") { | 2205 } else if (metric == "wasAlternateProtocolAvailable") { |
2219 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; | 2206 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; |
2220 } else if (metric == "connectionInfo") { | 2207 } else if (metric == "connectionInfo") { |
2221 feature = UseCounter::ChromeLoadTimesConnectionInfo; | 2208 feature = UseCounter::ChromeLoadTimesConnectionInfo; |
2222 } | 2209 } |
2223 UseCounter::count(frame(), feature); | 2210 UseCounter::count(frame(), feature); |
2224 } | 2211 } |
2225 | 2212 |
2226 } // namespace blink | 2213 } // namespace blink |
OLD | NEW |