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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #include "ui/base/resource/resource_bundle.h" | 90 #include "ui/base/resource/resource_bundle.h" |
91 #include "webkit/glue/webpreferences.h" | 91 #include "webkit/glue/webpreferences.h" |
92 | 92 |
93 #if defined(OS_WIN) | 93 #if defined(OS_WIN) |
94 #include "chrome/browser/chrome_browser_main_win.h" | 94 #include "chrome/browser/chrome_browser_main_win.h" |
95 #elif defined(OS_MACOSX) | 95 #elif defined(OS_MACOSX) |
96 #include "chrome/browser/chrome_browser_main_mac.h" | 96 #include "chrome/browser/chrome_browser_main_mac.h" |
97 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" | 97 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
98 #elif defined(OS_CHROMEOS) | 98 #elif defined(OS_CHROMEOS) |
99 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 99 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
100 #include "chrome/browser/chromeos/login/user_manager.h" | |
101 #elif defined(OS_LINUX) || defined(OS_OPENBSD) | 100 #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
102 #include "chrome/browser/chrome_browser_main_linux.h" | 101 #include "chrome/browser/chrome_browser_main_linux.h" |
103 #elif defined(OS_POSIX) | 102 #elif defined(OS_POSIX) |
104 #include "chrome/browser/chrome_browser_main_posix.h" | 103 #include "chrome/browser/chrome_browser_main_posix.h" |
105 #endif | 104 #endif |
106 | 105 |
107 #if defined(TOOLKIT_USES_GTK) | 106 #if defined(TOOLKIT_USES_GTK) |
108 #include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" | 107 #include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" |
109 #endif | 108 #endif |
110 | 109 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 "okddffdblfhhnmhodogpojmfkjmhinfp", // Test SSH Client | 148 "okddffdblfhhnmhodogpojmfkjmhinfp", // Test SSH Client |
150 "pnhechapfaindjhompbnflcldabbghjo" // HTerm App (SSH Client) | 149 "pnhechapfaindjhompbnflcldabbghjo" // HTerm App (SSH Client) |
151 }; | 150 }; |
152 | 151 |
153 // Handles rewriting Web UI URLs. | 152 // Handles rewriting Web UI URLs. |
154 bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) { | 153 bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) { |
155 if (!ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL( | 154 if (!ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL( |
156 browser_context, *url)) | 155 browser_context, *url)) |
157 return false; | 156 return false; |
158 | 157 |
159 #if defined(OS_CHROMEOS) | |
160 // Special case : in ChromeOS in Guest mode bookmarks and history are | |
161 // disabled for security reasons. New tab page explains the reasons, so | |
162 // we redirect user to new tab page. | |
163 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) { | |
164 if (url->SchemeIs(chrome::kChromeUIScheme) && | |
165 (url->DomainIs(chrome::kChromeUIBookmarksHost) || | |
166 url->DomainIs(chrome::kChromeUIHistoryHost))) { | |
167 // Rewrite with new tab URL | |
168 *url = GURL(chrome::kChromeUINewTabURL); | |
169 } | |
170 } | |
171 #endif | |
172 | |
173 // Special case the new tab page. In older versions of Chrome, the new tab | 158 // Special case the new tab page. In older versions of Chrome, the new tab |
174 // page was hosted at chrome-internal:<blah>. This might be in people's saved | 159 // page was hosted at chrome-internal:<blah>. This might be in people's saved |
175 // sessions or bookmarks, so we say any URL with that scheme triggers the new | 160 // sessions or bookmarks, so we say any URL with that scheme triggers the new |
176 // tab page. | 161 // tab page. |
177 if (url->SchemeIs(chrome::kChromeInternalScheme)) { | 162 if (url->SchemeIs(chrome::kChromeInternalScheme)) { |
178 // Rewrite it with the proper new tab URL. | 163 // Rewrite it with the proper new tab URL. |
179 *url = GURL(chrome::kChromeUINewTabURL); | 164 *url = GURL(chrome::kChromeUINewTabURL); |
180 } | 165 } |
181 | 166 |
182 return true; | 167 return true; |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 #if defined(USE_NSS) | 1517 #if defined(USE_NSS) |
1533 crypto::CryptoModuleBlockingPasswordDelegate* | 1518 crypto::CryptoModuleBlockingPasswordDelegate* |
1534 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1519 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1535 const GURL& url) { | 1520 const GURL& url) { |
1536 return browser::NewCryptoModuleBlockingDialogDelegate( | 1521 return browser::NewCryptoModuleBlockingDialogDelegate( |
1537 browser::kCryptoModulePasswordKeygen, url.host()); | 1522 browser::kCryptoModulePasswordKeygen, url.host()); |
1538 } | 1523 } |
1539 #endif | 1524 #endif |
1540 | 1525 |
1541 } // namespace chrome | 1526 } // namespace chrome |
OLD | NEW |