summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_about_handler.h
blob: 8e6cf76d689808b4b8b8ce56de65cbc7c7258050 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) 2006-2008 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.

// Contains code for handling "about:" URLs in the browser process.

#ifndef CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H__
#define CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H__

#include <string>

#include "base/basictypes.h"
#include "base/image_util.h"
#include "chrome/browser/web_contents.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"

class GURL;
class Profile;
class ListValue;
class DictionaryValue;
class RenderProcessHost;
class AboutSource;
enum TabContentsType;
namespace process_util {
  struct CommittedKBytes;
  struct WorkingSetKBytes;
}

class BrowserAboutHandler : public WebContents {
 public:
  BrowserAboutHandler(Profile* profile,
                      SiteInstance* instance,
                      RenderViewHostFactory* render_view_factory);
  virtual ~BrowserAboutHandler() {}

  // We don't want a favicon on the about pages.
  virtual bool ShouldDisplayFavIcon() { return false; }
  // Enable javascript urls for the about pages.
  virtual bool BrowserAboutHandler::SupportsURL(GURL* url);

  // If |url| is a known "about:" URL, this method handles it
  // and sets |url| to an alternate URL indicating the real content to load.
  // (If it's not a URL that the function can handle, it's a no-op and returns
  // false.)
  static bool MaybeHandle(GURL* url, TabContentsType* type);

  // Renders a special page for "about:" which displays version information.
  static std::string AboutVersion();

  // Renders a special page for about:plugins.
  static std::string AboutPlugins();

  // Renders a special page for about:histograms.
  static std::string AboutHistograms(const std::string query);

  // Renders a special page about:objects (about tracked objects such as Tasks).
  static std::string AboutObjects(const std::string& query);

  // Renders a special page for about:dns.
  static std::string AboutDns();

  // Renders a special page for about:stats.
  static std::string AboutStats();

  // Renders a special page for "about:credits" which displays our
  // acknowledgements and legal information for code we depend on.
  static std::string AboutCredits();

  // Renders a special page for "about:terms" which displays our
  // terms and conditions.
  static std::string AboutTerms();

  // Renders a special page for about:memory which displays
  // information about current state.
  static void AboutMemory(AboutSource*, int request_id);

 private:
  ChromeURLDataManager::DataSource* about_source_;
  DISALLOW_EVIL_CONSTRUCTORS(BrowserAboutHandler);
};

#endif  // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H__