OLD | NEW |
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/ui/chrome_pages.h" | 5 #include "chrome/browser/ui/chrome_pages.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 break; | 112 break; |
113 case HELP_SOURCE_WEBUI: | 113 case HELP_SOURCE_WEBUI: |
114 url = GURL(kChromeHelpViaWebUIURL); | 114 url = GURL(kChromeHelpViaWebUIURL); |
115 break; | 115 break; |
116 default: | 116 default: |
117 NOTREACHED() << "Unhandled help source " << source; | 117 NOTREACHED() << "Unhandled help source " << source; |
118 } | 118 } |
119 ShowSingletonTab(browser, url); | 119 ShowSingletonTab(browser, url); |
120 } | 120 } |
121 | 121 |
| 122 void ShowPolicy(Browser* browser) { |
| 123 ShowSingletonTab(browser, GURL(kChromeUIPolicyURL)); |
| 124 } |
| 125 |
122 void ShowSettings(Browser* browser) { | 126 void ShowSettings(Browser* browser) { |
123 content::RecordAction(UserMetricsAction("ShowOptions")); | 127 content::RecordAction(UserMetricsAction("ShowOptions")); |
124 ShowSettingsSubPage(browser, std::string()); | 128 ShowSettingsSubPage(browser, std::string()); |
125 } | 129 } |
126 | 130 |
127 void ShowSettingsSubPage(Browser* browser, const std::string& sub_page) { | 131 void ShowSettingsSubPage(Browser* browser, const std::string& sub_page) { |
128 std::string url = std::string(kChromeUISettingsURL) + sub_page; | 132 std::string url = std::string(kChromeUISettingsURL) + sub_page; |
129 #if defined(OS_CHROMEOS) | 133 #if defined(OS_CHROMEOS) |
130 if (sub_page.find(kInternetOptionsSubPage, 0) != std::string::npos) { | 134 if (sub_page.find(kInternetOptionsSubPage, 0) != std::string::npos) { |
131 std::string::size_type loc = sub_page.find("?", 0); | 135 std::string::size_type loc = sub_page.find("?", 0); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 GURL url(GaiaUrls::GetInstance()->service_login_url()); | 211 GURL url(GaiaUrls::GetInstance()->service_login_url()); |
208 url = chrome_common_net::AppendQueryParameter(url, "service", service); | 212 url = chrome_common_net::AppendQueryParameter(url, "service", service); |
209 if (continue_url.is_valid()) | 213 if (continue_url.is_valid()) |
210 url = chrome_common_net::AppendQueryParameter(url, | 214 url = chrome_common_net::AppendQueryParameter(url, |
211 "continue", | 215 "continue", |
212 continue_url.spec()); | 216 continue_url.spec()); |
213 NavigateToSingletonTab(browser, url); | 217 NavigateToSingletonTab(browser, url); |
214 } | 218 } |
215 | 219 |
216 } // namespace chrome | 220 } // namespace chrome |
OLD | NEW |