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

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

Issue 149643010: Cleanup: Move kChromeUIScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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/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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 if (!ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL( 368 if (!ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL(
369 browser_context, *url)) 369 browser_context, *url))
370 return false; 370 return false;
371 371
372 #if defined(OS_CHROMEOS) 372 #if defined(OS_CHROMEOS)
373 // Special case : in ChromeOS in Guest mode bookmarks and history are 373 // Special case : in ChromeOS in Guest mode bookmarks and history are
374 // disabled for security reasons. New tab page explains the reasons, so 374 // disabled for security reasons. New tab page explains the reasons, so
375 // we redirect user to new tab page. 375 // we redirect user to new tab page.
376 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) { 376 if (chromeos::UserManager::Get()->IsLoggedInAsGuest()) {
377 if (url->SchemeIs(chrome::kChromeUIScheme) && 377 if (url->SchemeIs(content::kChromeUIScheme) &&
378 (url->DomainIs(chrome::kChromeUIBookmarksHost) || 378 (url->DomainIs(chrome::kChromeUIBookmarksHost) ||
379 #if defined(ENABLE_ENHANCED_BOOKMARKS) 379 #if defined(ENABLE_ENHANCED_BOOKMARKS)
380 url->DomainIs(chrome::kChromeUIEnhancedBookmarksHost) || 380 url->DomainIs(chrome::kChromeUIEnhancedBookmarksHost) ||
381 #endif 381 #endif
382 url->DomainIs(chrome::kChromeUIHistoryHost))) { 382 url->DomainIs(chrome::kChromeUIHistoryHost))) {
383 // Rewrite with new tab URL 383 // Rewrite with new tab URL
384 *url = GURL(chrome::kChromeUINewTabURL); 384 *url = GURL(chrome::kChromeUINewTabURL);
385 } 385 }
386 } 386 }
387 #endif 387 #endif
388 388
389 return true; 389 return true;
390 } 390 }
391 391
392 // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to 392 // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to
393 // "chrome://foo/". 393 // "chrome://foo/".
394 bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) { 394 bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) {
395 if (!url->is_valid() || !url->SchemeIs(chrome::kChromeUIScheme)) 395 if (!url->is_valid() || !url->SchemeIs(content::kChromeUIScheme))
396 return false; 396 return false;
397 397
398 return RemoveUberHost(url); 398 return RemoveUberHost(url);
399 } 399 }
400 400
401 // Used by the GetPrivilegeRequiredByUrl() and GetProcessPrivilege() functions 401 // Used by the GetPrivilegeRequiredByUrl() and GetProcessPrivilege() functions
402 // below. Extension, and isolated apps require different privileges to be 402 // below. Extension, and isolated apps require different privileges to be
403 // granted to their RenderProcessHosts. This classification allows us to make 403 // granted to their RenderProcessHosts. This classification allows us to make
404 // sure URLs are served by hosts with the right set of privileges. 404 // sure URLs are served by hosts with the right set of privileges.
405 enum RenderProcessHostPrivilege { 405 enum RenderProcessHostPrivilege {
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2529 ui::SelectFilePolicy* ChromeContentBrowserClient::CreateSelectFilePolicy( 2529 ui::SelectFilePolicy* ChromeContentBrowserClient::CreateSelectFilePolicy(
2530 WebContents* web_contents) { 2530 WebContents* web_contents) {
2531 return new ChromeSelectFilePolicy(web_contents); 2531 return new ChromeSelectFilePolicy(web_contents);
2532 } 2532 }
2533 2533
2534 void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( 2534 void ChromeContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
2535 std::vector<std::string>* additional_allowed_schemes) { 2535 std::vector<std::string>* additional_allowed_schemes) {
2536 ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( 2536 ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem(
2537 additional_allowed_schemes); 2537 additional_allowed_schemes);
2538 additional_allowed_schemes->push_back(kChromeDevToolsScheme); 2538 additional_allowed_schemes->push_back(kChromeDevToolsScheme);
2539 additional_allowed_schemes->push_back(kChromeUIScheme); 2539 additional_allowed_schemes->push_back(content::kChromeUIScheme);
2540 additional_allowed_schemes->push_back(extensions::kExtensionScheme); 2540 additional_allowed_schemes->push_back(extensions::kExtensionScheme);
2541 } 2541 }
2542 2542
2543 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( 2543 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends(
2544 content::BrowserContext* browser_context, 2544 content::BrowserContext* browser_context,
2545 const base::FilePath& storage_partition_path, 2545 const base::FilePath& storage_partition_path,
2546 ScopedVector<fileapi::FileSystemBackend>* additional_backends) { 2546 ScopedVector<fileapi::FileSystemBackend>* additional_backends) {
2547 #if !defined(OS_ANDROID) 2547 #if !defined(OS_ANDROID)
2548 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); 2548 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool();
2549 additional_backends->push_back(new MediaFileSystemBackend( 2549 additional_backends->push_back(new MediaFileSystemBackend(
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2702 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on 2702 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on
2703 // Chromium builds as well. 2703 // Chromium builds as well.
2704 return channel <= chrome::VersionInfo::CHANNEL_DEV; 2704 return channel <= chrome::VersionInfo::CHANNEL_DEV;
2705 #else 2705 #else
2706 return false; 2706 return false;
2707 #endif 2707 #endif
2708 } 2708 }
2709 2709
2710 2710
2711 } // namespace chrome 2711 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698