Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/browser/browser_about_handler.cc

Issue 449623003: Integrate About page into Settings for Chrome OS settings in a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: About in Settings Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/browser_about_handler.h" 5 #include "chrome/browser/browser_about_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "chrome/browser/lifetime/application_lifetime.h" 11 #include "chrome/browser/lifetime/application_lifetime.h"
12 #include "chrome/browser/ui/browser_dialogs.h" 12 #include "chrome/browser/ui/browser_dialogs.h"
13 #include "chrome/common/chrome_switches.h"
13 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
14 #include "components/url_fixer/url_fixer.h" 15 #include "components/url_fixer/url_fixer.h"
15 16
16 bool WillHandleBrowserAboutURL(GURL* url, 17 bool WillHandleBrowserAboutURL(GURL* url,
17 content::BrowserContext* browser_context) { 18 content::BrowserContext* browser_context) {
18 // TODO(msw): Eliminate "about:*" constants and literals from code and tests, 19 // TODO(msw): Eliminate "about:*" constants and literals from code and tests,
19 // then hopefully we can remove this forced fixup. 20 // then hopefully we can remove this forced fixup.
20 *url = url_fixer::FixupURL(url->possibly_invalid_spec(), std::string()); 21 *url = url_fixer::FixupURL(url->possibly_invalid_spec(), std::string());
21 22
22 // Check that about: URLs are fixed up to chrome: by url_fixer::FixupURL. 23 // Check that about: URLs are fixed up to chrome: by url_fixer::FixupURL.
(...skipping 29 matching lines...) Expand all
52 #if defined(OS_ANDROID) 53 #if defined(OS_ANDROID)
53 // On Android, redirect directly to chrome://history-frame since 54 // On Android, redirect directly to chrome://history-frame since
54 // uber page is unsupported. 55 // uber page is unsupported.
55 host = chrome::kChromeUIHistoryFrameHost; 56 host = chrome::kChromeUIHistoryFrameHost;
56 #else 57 #else
57 host = chrome::kChromeUIUberHost; 58 host = chrome::kChromeUIUberHost;
58 path = chrome::kChromeUIHistoryHost + url->path(); 59 path = chrome::kChromeUIHistoryHost + url->path();
59 #endif 60 #endif
60 // Redirect chrome://settings 61 // Redirect chrome://settings
61 } else if (host == chrome::kChromeUISettingsHost) { 62 } else if (host == chrome::kChromeUISettingsHost) {
62 host = chrome::kChromeUIUberHost; 63 if (::switches::AboutInSettingsEnabled()) {
63 path = chrome::kChromeUISettingsHost + url->path(); 64 host = chrome::kChromeUISettingsFrameHost;
michaelpg 2014/08/07 08:17:07 So, this makes chrome://settings load the settings
michaelpg 2014/08/07 19:33:48 I think I'm being dumb, since we're loading resour
65 } else {
66 host = chrome::kChromeUIUberHost;
67 path = chrome::kChromeUISettingsHost + url->path();
68 }
64 // Redirect chrome://help 69 // Redirect chrome://help
65 } else if (host == chrome::kChromeUIHelpHost) { 70 } else if (host == chrome::kChromeUIHelpHost) {
66 host = chrome::kChromeUIUberHost; 71 if (::switches::AboutInSettingsEnabled()) {
67 path = chrome::kChromeUIHelpHost + url->path(); 72 host = chrome::kChromeUISettingsFrameHost;
73 if (url->path().empty() || url->path() == std::string("/"))
Dan Beam 2014/08/07 22:36:16 why do you need std::string()?
michaelpg 2014/08/08 01:10:46 Done.
74 path = chrome::kChromeUIHelpHost;
75 } else {
76 host = chrome::kChromeUIUberHost;
77 path = chrome::kChromeUIHelpHost + url->path();
78 }
68 } 79 }
69 80
70 GURL::Replacements replacements; 81 GURL::Replacements replacements;
71 replacements.SetHostStr(host); 82 replacements.SetHostStr(host);
72 if (!path.empty()) 83 if (!path.empty())
73 replacements.SetPathStr(path); 84 replacements.SetPathStr(path);
74 *url = url->ReplaceComponents(replacements); 85 *url = url->ReplaceComponents(replacements);
75 86
76 // Having re-written the URL, make the chrome: handler process it. 87 // Having re-written the URL, make the chrome: handler process it.
77 return false; 88 return false;
(...skipping 22 matching lines...) Expand all
100 // Run the dialog. This will re-use the existing one if it's already up. 111 // Run the dialog. This will re-use the existing one if it's already up.
101 chrome::ShowAboutIPCDialog(); 112 chrome::ShowAboutIPCDialog();
102 return true; 113 return true;
103 } 114 }
104 #endif 115 #endif
105 116
106 #endif // OFFICIAL_BUILD 117 #endif // OFFICIAL_BUILD
107 118
108 return false; 119 return false;
109 } 120 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/help/help_page.js » ('j') | chrome/browser/resources/help/help_page.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698