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"
16 } // namespace content
18 namespace extensions
{
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
,
27 EnhancedBookmarkKeyService(content::BrowserContext
* context
);
28 ~EnhancedBookmarkKeyService() override
;
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_