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

Unified Diff: chrome/browser/chromeos/extensions/dictionary_event_router.h

Issue 973213003: Adds extension events for custom dictionary load/change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Remove extra braces. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/dictionary_event_router.h
diff --git a/chrome/browser/chromeos/extensions/dictionary_event_router.h b/chrome/browser/chromeos/extensions/dictionary_event_router.h
new file mode 100644
index 0000000000000000000000000000000000000000..a11483893f7910555467ba14d7101233052b0413
--- /dev/null
+++ b/chrome/browser/chromeos/extensions/dictionary_event_router.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_DICTIONARY_EVENT_ROUTER_H_
+#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_DICTIONARY_EVENT_ROUTER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h"
+#include "chrome/browser/spellchecker/spellcheck_service.h"
+
+namespace content {
+class BrowserContext;
+}
+
+namespace chromeos {
+
+// Event router class for custom dictionary events.
+class ExtensionDictionaryEventRouter
+ : public SpellcheckCustomDictionary::Observer {
+ public:
+ explicit ExtensionDictionaryEventRouter(content::BrowserContext* context);
+ virtual ~ExtensionDictionaryEventRouter();
+
+ // SpellcheckCustomDictionary::Observer implementation.
+ void OnCustomDictionaryLoaded() override;
+ void OnCustomDictionaryChanged(
+ const SpellcheckCustomDictionary::Change& dictionary_change) override;
+
+ private:
+ content::BrowserContext* context_;
+ base::WeakPtr<SpellcheckService> service_;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionDictionaryEventRouter);
+};
+
+} // namespace chromeos
+#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_DICTIONARY_EVENT_ROUTER_H_

Powered by Google App Engine
This is Rietveld 408576698