| 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 <map> | 7 #include <map> | 
| 8 #include <set> | 8 #include <set> | 
| 9 #include <utility> | 9 #include <utility> | 
| 10 #include <vector> | 10 #include <vector> | 
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 615     return false; | 615     return false; | 
| 616 | 616 | 
| 617   *url = GURL(ntp_location); | 617   *url = GURL(ntp_location); | 
| 618   return true; | 618   return true; | 
| 619 } | 619 } | 
| 620 | 620 | 
| 621 // Handles rewriting Web UI URLs. | 621 // Handles rewriting Web UI URLs. | 
| 622 bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) { | 622 bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) { | 
| 623   if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { | 623   if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings)) { | 
| 624     // Rewrite chrome://help and chrome://chrome to chrome://settings/help. | 624     // Rewrite chrome://help and chrome://chrome to chrome://settings/help. | 
| 625     if (url->host() == chrome::kChromeUIHelpHost || | 625     if (url->host() == content::kChromeUIHelpHost || | 
| 626         (url->host() == chrome::kChromeUIUberHost && | 626         (url->host() == chrome::kChromeUIUberHost && | 
| 627          (url->path().empty() || url->path() == "/"))) { | 627          (url->path().empty() || url->path() == "/"))) { | 
| 628       *url = ReplaceURLHostAndPath(*url, chrome::kChromeUISettingsHost, | 628       *url = ReplaceURLHostAndPath(*url, content::kChromeUISettingsHost, | 
| 629                                    chrome::kChromeUIHelpHost); | 629                                    content::kChromeUIHelpHost); | 
| 630       return true;  // Return true to update the displayed URL. | 630       return true;  // Return true to update the displayed URL. | 
| 631     } | 631     } | 
| 632   } | 632   } | 
| 633 | 633 | 
| 634   // Do not handle special URLs such as "about:foo" | 634   // Do not handle special URLs such as "about:foo" | 
| 635   if (!url->host().empty()) { | 635   if (!url->host().empty()) { | 
| 636     const GURL chrome_url = AddUberHost(*url); | 636     const GURL chrome_url = AddUberHost(*url); | 
| 637 | 637 | 
| 638     // Handle valid "chrome://chrome/foo" URLs so the reverse handler will | 638     // Handle valid "chrome://chrome/foo" URLs so the reverse handler will | 
| 639     // be called. | 639     // be called. | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 662 | 662 | 
| 663   return true; | 663   return true; | 
| 664 } | 664 } | 
| 665 | 665 | 
| 666 // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to | 666 // Reverse URL handler for Web UI. Maps "chrome://chrome/foo/" to | 
| 667 // "chrome://foo/". | 667 // "chrome://foo/". | 
| 668 bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) { | 668 bool HandleWebUIReverse(GURL* url, content::BrowserContext* browser_context) { | 
| 669   // No need to actually reverse-rewrite the URL, but return true to update the | 669   // No need to actually reverse-rewrite the URL, but return true to update the | 
| 670   // displayed URL when rewriting chrome://help to chrome://settings/help. | 670   // displayed URL when rewriting chrome://help to chrome://settings/help. | 
| 671   if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && | 671   if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && | 
| 672       url->host() == chrome::kChromeUISettingsHost) { | 672       url->host() == content::kChromeUISettingsHost) { | 
| 673     return true; | 673     return true; | 
| 674   } | 674   } | 
| 675 | 675 | 
| 676   if (!url->is_valid() || !url->SchemeIs(content::kChromeUIScheme)) | 676   if (!url->is_valid() || !url->SchemeIs(content::kChromeUIScheme)) | 
| 677     return false; | 677     return false; | 
| 678 | 678 | 
| 679   return RemoveUberHost(url); | 679   return RemoveUberHost(url); | 
| 680 } | 680 } | 
| 681 | 681 | 
| 682 bool CertMatchesFilter(const net::X509Certificate& cert, | 682 bool CertMatchesFilter(const net::X509Certificate& cert, | 
| (...skipping 2868 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3551     RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3551     RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 
| 3552   return variations::GetVariationParamValue( | 3552   return variations::GetVariationParamValue( | 
| 3553              "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3553              "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 
| 3554 } | 3554 } | 
| 3555 | 3555 | 
| 3556 // static | 3556 // static | 
| 3557 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3557 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 
| 3558     const storage::QuotaSettings* settings) { | 3558     const storage::QuotaSettings* settings) { | 
| 3559   g_default_quota_settings = settings; | 3559   g_default_quota_settings = settings; | 
| 3560 } | 3560 } | 
| OLD | NEW | 
|---|