Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: chrome/browser/spellchecker/spellcheck_host_impl.h

Issue 2857353002: Convert Spellcheck host MessageFilter IPC to mojo (Closed)
Patch Set: Use MakeUnique for the MessageLoop in TestingSpellCheckProvider. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_
6 #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_
7
8 #include <memory>
9 #include <vector>
10
11 #include "base/macros.h"
12 #include "components/spellcheck/common/spellcheck.mojom.h"
13 #include "components/spellcheck/spellcheck_build_features.h"
14
15 #if !BUILDFLAG(ENABLE_SPELLCHECK)
16 #error "Spellcheck should be enabled."
17 #endif
18
19 class SpellcheckCustomDictionary;
20 class SpellcheckService;
21 class SpellingServiceClient;
22
23 struct SpellCheckResult;
24
25 namespace service_manager {
26 struct BindSourceInfo;
27 }
28
29 class SpellCheckHostImpl : public spellcheck::mojom::SpellCheckHost {
30 public:
31 explicit SpellCheckHostImpl(int render_process_id);
32 ~SpellCheckHostImpl() override;
33
34 static void Create(int render_process_id,
35 const service_manager::BindSourceInfo& source_info,
36 spellcheck::mojom::SpellCheckHostRequest request);
37
38 private:
39 friend class TestSpellCheckHostImpl;
40
41 // spellcheck::mojom::SpellCheckHost:
42 void RequestDictionary() override;
43 void NotifyChecked(const base::string16& word, bool misspelled) override;
44 void CallSpellingService(
45 const base::string16& text,
46 const CallSpellingServiceCallback& callback) override;
47
48 #if !BUILDFLAG(USE_BROWSER_SPELLCHECKER)
49 // Invoked when the remote Spelling service has finished checking the
50 // text of a CallSpellingService request.
51 void CallSpellingServiceDone(
52 const CallSpellingServiceCallback& callback,
53 bool success,
54 const base::string16& text,
55 const std::vector<SpellCheckResult>& service_results);
56
57 // Filter out spelling corrections of custom dictionary words from the
58 // Spelling service results.
59 static std::vector<SpellCheckResult> FilterCustomWordResults(
60 const std::string& text,
61 const SpellcheckCustomDictionary& custom_dictionary,
62 const std::vector<SpellCheckResult>& service_results);
63 #endif
64
65 // Returns the SpellcheckService of our |render_process_id_|.
66 virtual SpellcheckService* GetSpellcheckService() const;
67
68 // The process ID of our render process host.
69 int render_process_id_;
70
71 // A JSON-RPC client that calls the remote Spelling service.
72 std::unique_ptr<SpellingServiceClient> client_;
73
74 DISALLOW_COPY_AND_ASSIGN(SpellCheckHostImpl);
75 };
76
77 #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_site_per_process_browsertest.cc ('k') | chrome/browser/spellchecker/spellcheck_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698