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 blink; | |
41 | |
42 namespace blink { | 40 namespace blink { |
43 | 41 |
44 static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingR
esult>& results) | 42 static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingR
esult>& results) |
45 { | 43 { |
46 Vector<TextCheckingResult> coreResults; | 44 Vector<TextCheckingResult> coreResults; |
47 for (size_t i = 0; i < results.size(); ++i) | 45 for (size_t i = 0; i < results.size(); ++i) |
48 coreResults.append(results[i]); | 46 coreResults.append(results[i]); |
49 return coreResults; | 47 return coreResults; |
50 } | 48 } |
51 | 49 |
52 void WebTextCheckingCompletionImpl::didFinishCheckingText(const WebVector<WebTex
tCheckingResult>& results) | 50 void WebTextCheckingCompletionImpl::didFinishCheckingText(const WebVector<WebTex
tCheckingResult>& results) |
53 { | 51 { |
54 m_request->didSucceed(toCoreResults(results)); | 52 m_request->didSucceed(toCoreResults(results)); |
55 delete this; | 53 delete this; |
56 } | 54 } |
57 | 55 |
58 void WebTextCheckingCompletionImpl::didCancelCheckingText() | 56 void WebTextCheckingCompletionImpl::didCancelCheckingText() |
59 { | 57 { |
60 m_request->didCancel(); | 58 m_request->didCancel(); |
61 delete this; | 59 delete this; |
62 } | 60 } |
63 | 61 |
64 } // namespace blink | 62 } // namespace blink |
OLD | NEW |