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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "web/WebTextCheckingCompletionImpl.h" | 32 #include "web/WebTextCheckingCompletionImpl.h" |
33 | 33 |
34 #include "platform/text/TextCheckerClient.h" | 34 #include "platform/text/TextCheckerClient.h" |
35 #include "public/platform/WebVector.h" | 35 #include "public/platform/WebVector.h" |
36 #include "public/web/WebTextCheckingResult.h" | 36 #include "public/web/WebTextCheckingResult.h" |
37 #include "web/EditorClientImpl.h" | 37 #include "web/EditorClientImpl.h" |
38 #include "wtf/Assertions.h" | 38 #include "wtf/Assertions.h" |
39 | 39 |
40 using namespace WebCore; | 40 using namespace blink; |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingR
esult>& results) | 44 static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingR
esult>& results) |
45 { | 45 { |
46 Vector<TextCheckingResult> coreResults; | 46 Vector<TextCheckingResult> coreResults; |
47 for (size_t i = 0; i < results.size(); ++i) | 47 for (size_t i = 0; i < results.size(); ++i) |
48 coreResults.append(results[i]); | 48 coreResults.append(results[i]); |
49 return coreResults; | 49 return coreResults; |
50 } | 50 } |
51 | 51 |
52 void WebTextCheckingCompletionImpl::didFinishCheckingText(const WebVector<WebTex
tCheckingResult>& results) | 52 void WebTextCheckingCompletionImpl::didFinishCheckingText(const WebVector<WebTex
tCheckingResult>& results) |
53 { | 53 { |
54 m_request->didSucceed(toCoreResults(results)); | 54 m_request->didSucceed(toCoreResults(results)); |
55 delete this; | 55 delete this; |
56 } | 56 } |
57 | 57 |
58 void WebTextCheckingCompletionImpl::didCancelCheckingText() | 58 void WebTextCheckingCompletionImpl::didCancelCheckingText() |
59 { | 59 { |
60 m_request->didCancel(); | 60 m_request->didCancel(); |
61 delete this; | 61 delete this; |
62 } | 62 } |
63 | 63 |
64 } // namespace blink | 64 } // namespace blink |
OLD | NEW |