bookmarks_ui.h revision ddb351dbec246cf1fab5ec20d2d5520909041de1
1// Copyright (c) 2011 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_UI_WEBUI_BOOKMARKS_UI_H_
6#define CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_
7#pragma once
8
9#include <string>
10
11#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
12#include "content/browser/webui/web_ui.h"
13
14class GURL;
15class RefCountedMemory;
16
17// This class provides the source for chrome://bookmarks/
18class BookmarksUIHTMLSource : public ChromeURLDataManager::DataSource {
19 public:
20  BookmarksUIHTMLSource();
21
22  // Called when the network layer has requested a resource underneath
23  // the path we registered.
24  virtual void StartDataRequest(const std::string& path,
25                                bool is_incognito,
26                                int request_id);
27  virtual std::string GetMimeType(const std::string& path) const;
28
29 private:
30  DISALLOW_COPY_AND_ASSIGN(BookmarksUIHTMLSource);
31};
32
33// This class is used to hook up chrome://bookmarks/ which in turn gets
34// overridden by an extension.
35class BookmarksUI : public WebUI {
36 public:
37  explicit BookmarksUI(TabContents* contents);
38
39  static RefCountedMemory* GetFaviconResourceBytes();
40
41 private:
42  DISALLOW_COPY_AND_ASSIGN(BookmarksUI);
43};
44
45#endif  // CHROME_BROWSER_UI_WEBUI_BOOKMARKS_UI_H_
46