OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Contains code for handling "about:" URLs in the browser process. | 5 // Contains code for handling "about:" URLs in the browser process. |
6 | 6 |
7 #ifndef CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ | 7 #ifndef CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ |
8 #define CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ | 8 #define CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/process.h" | 14 #include "base/process.h" |
15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
16 | 16 |
17 template <typename T> struct DefaultSingletonTraits; | 17 template <typename T> struct DefaultSingletonTraits; |
18 class GURL; | 18 class GURL; |
19 class Profile; | 19 class Profile; |
20 | 20 |
21 // Decides whether the given URL will be handled by the browser about handler | 21 // Decides whether the given URL will be handled by the browser about handler |
22 // and returns true if so. On true, it may also modify the given URL to be the | 22 // and returns true if so. On true, it may also modify the given URL to be the |
23 // final form (we fix up most "about:" URLs to be "chrome:" because WebKit | 23 // final form (we fix up most "about:" URLs to be "chrome:" because WebKit |
24 // handles all "about:" URLs as "about:blank. | 24 // handles all "about:" URLs as "about:blank. |
25 // | 25 // |
26 // This is used by BrowserURLHandler. | 26 // This is used by BrowserURLHandler. |
27 bool WillHandleBrowserAboutURL(GURL* url, Profile* profile); | 27 bool WillHandleBrowserAboutURL(GURL* url, Profile* profile); |
28 | 28 |
| 29 // Register the data source for chrome://about URLs. |
| 30 // Safe to call multiple times. |
| 31 void InitializeAboutDataSource(); |
| 32 |
29 // We have a few magic commands that don't cause navigations, but rather pop up | 33 // We have a few magic commands that don't cause navigations, but rather pop up |
30 // dialogs. This function handles those cases, and returns true if so. In this | 34 // dialogs. This function handles those cases, and returns true if so. In this |
31 // case, normal tab navigation should be skipped. | 35 // case, normal tab navigation should be skipped. |
32 bool HandleNonNavigationAboutURL(const GURL& url); | 36 bool HandleNonNavigationAboutURL(const GURL& url); |
33 | 37 |
34 #if defined(USE_TCMALLOC) | 38 #if defined(USE_TCMALLOC) |
35 // A map of header strings (e.g. "Browser", "Renderer PID 123") | 39 // A map of header strings (e.g. "Browser", "Renderer PID 123") |
36 // to the tcmalloc output collected for each process. | 40 // to the tcmalloc output collected for each process. |
37 typedef std::map<std::string, std::string> AboutTcmallocOutputsType; | 41 typedef std::map<std::string, std::string> AboutTcmallocOutputsType; |
38 | 42 |
(...skipping 24 matching lines...) Expand all Loading... |
63 friend struct DefaultSingletonTraits<AboutTcmallocOutputs>; | 67 friend struct DefaultSingletonTraits<AboutTcmallocOutputs>; |
64 | 68 |
65 DISALLOW_COPY_AND_ASSIGN(AboutTcmallocOutputs); | 69 DISALLOW_COPY_AND_ASSIGN(AboutTcmallocOutputs); |
66 }; | 70 }; |
67 | 71 |
68 // Glue between the callback task and the method in the singleton. | 72 // Glue between the callback task and the method in the singleton. |
69 void AboutTcmallocRendererCallback(base::ProcessId pid, std::string output); | 73 void AboutTcmallocRendererCallback(base::ProcessId pid, std::string output); |
70 #endif | 74 #endif |
71 | 75 |
72 #endif // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ | 76 #endif // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ |
OLD | NEW |