Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / bookmarks / enhanced_bookmark_key_service.h
blob6e51431ee1f6c7646860ec55264e1020fe166c12
1 // Copyright 2015 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.
5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_H_
6 #define CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_H_
8 #include "components/keyed_service/core/keyed_service.h"
9 #include "content/public/browser/notification_details.h"
10 #include "content/public/browser/notification_observer.h"
11 #include "content/public/browser/notification_registrar.h"
12 #include "content/public/browser/notification_source.h"
14 namespace content {
15 class BrowserContext;
16 } // namespace content
18 namespace extensions {
19 class Extension;
20 } // namespace extensions
22 // Maintains assignment of bookmark keybinding on the enhanced bookmarks
23 // extension when not assigned to other extensions.
24 class EnhancedBookmarkKeyService : public content::NotificationObserver,
25 public KeyedService {
26 public:
27 EnhancedBookmarkKeyService(content::BrowserContext* context);
28 ~EnhancedBookmarkKeyService() override;
30 private:
31 // Overridden from content::NotificationObserver:
32 void Observe(int type,
33 const content::NotificationSource& source,
34 const content::NotificationDetails& details) override;
36 const extensions::Extension* GetEnhancedBookmarkExtension() const;
38 // The content notification registrar for listening to extension key events.
39 content::NotificationRegistrar registrar_;
41 content::BrowserContext* browser_context_;
43 DISALLOW_COPY_AND_ASSIGN(EnhancedBookmarkKeyService);
46 #endif // CHROME_BROWSER_UI_BOOKMARKS_ENHANCED_BOOKMARK_KEY_SERVICE_H_