[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / bookmarks / chrome_bookmark_client.h
blobb1caf698eb651d9ce773ad50a1ecf7a768e9ff94
1 // Copyright 2014 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_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_
6 #define CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_
8 #include "base/compiler_specific.h"
9 #include "components/bookmarks/browser/base_bookmark_model_observer.h"
10 #include "components/bookmarks/browser/bookmark_client.h"
11 #include "components/keyed_service/core/keyed_service.h"
12 #include "content/public/browser/notification_observer.h"
13 #include "content/public/browser/notification_registrar.h"
15 class BookmarkModel;
16 class Profile;
18 class ChromeBookmarkClient : public BookmarkClient,
19 public content::NotificationObserver,
20 public KeyedService,
21 public BaseBookmarkModelObserver {
22 public:
23 // |index_urls| says whether URLs should be stored in the BookmarkIndex
24 // in addition to bookmark titles.
25 ChromeBookmarkClient(Profile* profile, bool index_urls);
26 virtual ~ChromeBookmarkClient();
28 // Returns the BookmarkModel that corresponds to this ChromeBookmarkClient.
29 BookmarkModel* model() { return model_.get(); }
31 // BookmarkClient:
32 virtual bool PreferTouchIcon() OVERRIDE;
33 virtual base::CancelableTaskTracker::TaskId GetFaviconImageForURL(
34 const GURL& page_url,
35 int icon_types,
36 int desired_size_in_dip,
37 const FaviconImageCallback& callback,
38 base::CancelableTaskTracker* tracker) OVERRIDE;
39 virtual bool SupportsTypedCountForNodes() OVERRIDE;
40 virtual void GetTypedCountForNodes(
41 const NodeSet& nodes,
42 NodeTypedCountPairs* node_typed_count_pairs) OVERRIDE;
43 virtual bool IsPermanentNodeVisible(int node_type) OVERRIDE;
44 virtual void RecordAction(const base::UserMetricsAction& action) OVERRIDE;
46 // content::NotificationObserver:
47 virtual void Observe(int type,
48 const content::NotificationSource& source,
49 const content::NotificationDetails& details) OVERRIDE;
51 // KeyedService:
52 virtual void Shutdown() OVERRIDE;
54 private:
55 // BaseBookmarkModelObserver:
56 virtual void BookmarkModelChanged() OVERRIDE;
57 virtual void BookmarkNodeRemoved(BookmarkModel* model,
58 const BookmarkNode* parent,
59 int old_index,
60 const BookmarkNode* node,
61 const std::set<GURL>& removed_urls) OVERRIDE;
62 virtual void BookmarkAllNodesRemoved(
63 BookmarkModel* model,
64 const std::set<GURL>& removed_urls) OVERRIDE;
66 Profile* profile_;
68 content::NotificationRegistrar registrar_;
70 scoped_ptr<BookmarkModel> model_;
72 DISALLOW_COPY_AND_ASSIGN(ChromeBookmarkClient);
75 #endif // CHROME_BROWSER_BOOKMARKS_CHROME_BOOKMARK_CLIENT_H_