| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/process.h" | 15 #include "base/process.h" |
| 16 #include "base/stringprintf.h" | 16 #include "base/stringprintf.h" |
| 17 | 17 |
| 18 template <typename T> struct DefaultSingletonTraits; | 18 template <typename T> struct DefaultSingletonTraits; |
| 19 class GURL; | 19 class GURL; |
| 20 class Profile; | 20 class Profile; |
| 21 | 21 |
| 22 namespace content { |
| 23 class BrowserContext; |
| 24 } |
| 25 |
| 22 // Register a data source for a known source name. Safe to call multiple times. | 26 // Register a data source for a known source name. Safe to call multiple times. |
| 23 // |name| may be an unkown host (e.g. "chrome://foo/"); only handle known hosts. | 27 // |name| may be an unkown host (e.g. "chrome://foo/"); only handle known hosts. |
| 24 // In general case WillHandleBrowserAboutURL will initialize all data sources. | 28 // In general case WillHandleBrowserAboutURL will initialize all data sources. |
| 25 // But in some case like navigating to chrome://oobe on boot and loading | 29 // But in some case like navigating to chrome://oobe on boot and loading |
| 26 // chrome://terms in an iframe there, kChromeUITermsHost data source needs to | 30 // chrome://terms in an iframe there, kChromeUITermsHost data source needs to |
| 27 // be initialized separately. | 31 // be initialized separately. |
| 28 void InitializeAboutDataSource(const std::string& name, Profile* profile); | 32 void InitializeAboutDataSource(const std::string& name, |
| 33 content::BrowserContext* browser_context); |
| 29 | 34 |
| 30 // Returns true if the given URL will be handled by the browser about handler. | 35 // Returns true if the given URL will be handled by the browser about handler. |
| 31 // |url| should have been processed by URLFixerUpper::FixupURL, which replaces | 36 // |url| should have been processed by URLFixerUpper::FixupURL, which replaces |
| 32 // the about: scheme with chrome:// for all about:foo URLs except "about:blank". | 37 // the about: scheme with chrome:// for all about:foo URLs except "about:blank". |
| 33 // Some |url| host values will be replaced with their respective redirects. | 38 // Some |url| host values will be replaced with their respective redirects. |
| 34 // | 39 // |
| 35 // This is used by BrowserURLHandler. | 40 // This is used by BrowserURLHandler. |
| 36 bool WillHandleBrowserAboutURL(GURL* url, Profile* profile); | 41 bool WillHandleBrowserAboutURL(GURL* url, |
| 42 content::BrowserContext* browser_context); |
| 37 | 43 |
| 38 // We have a few magic commands that don't cause navigations, but rather pop up | 44 // We have a few magic commands that don't cause navigations, but rather pop up |
| 39 // dialogs. This function handles those cases, and returns true if so. In this | 45 // dialogs. This function handles those cases, and returns true if so. In this |
| 40 // case, normal tab navigation should be skipped. | 46 // case, normal tab navigation should be skipped. |
| 41 bool HandleNonNavigationAboutURL(const GURL& url); | 47 bool HandleNonNavigationAboutURL(const GURL& url); |
| 42 | 48 |
| 43 // Gets the paths that are shown in chrome://chrome-urls. | 49 // Gets the paths that are shown in chrome://chrome-urls. |
| 44 std::vector<std::string> ChromePaths(); | 50 std::vector<std::string> ChromePaths(); |
| 45 | 51 |
| 46 #if defined(USE_TCMALLOC) | 52 #if defined(USE_TCMALLOC) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 84 |
| 79 DISALLOW_COPY_AND_ASSIGN(AboutTcmallocOutputs); | 85 DISALLOW_COPY_AND_ASSIGN(AboutTcmallocOutputs); |
| 80 }; | 86 }; |
| 81 | 87 |
| 82 // Glue between the callback task and the method in the singleton. | 88 // Glue between the callback task and the method in the singleton. |
| 83 void AboutTcmallocRendererCallback(base::ProcessId pid, | 89 void AboutTcmallocRendererCallback(base::ProcessId pid, |
| 84 const std::string& output); | 90 const std::string& output); |
| 85 #endif | 91 #endif |
| 86 | 92 |
| 87 #endif // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ | 93 #endif // CHROME_BROWSER_BROWSER_ABOUT_HANDLER_H_ |
| OLD | NEW |