summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete
diff options
context:
space:
mode:
authormhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-03 12:13:48 +0000
committermhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-03 12:13:48 +0000
commita21767477fef894a75d0b13a8da3da6cdc2f5e3e (patch)
treee45f5c969518b6a64ed54fc8d96ba28f4736aae7 /chrome/browser/autocomplete
parent13c68582fc7a22a18cde190d09393912124f75b0 (diff)
downloadchromium_src-a21767477fef894a75d0b13a8da3da6cdc2f5e3e.zip
chromium_src-a21767477fef894a75d0b13a8da3da6cdc2f5e3e.tar.gz
chromium_src-a21767477fef894a75d0b13a8da3da6cdc2f5e3e.tar.bz2
Foundations for Print Preview and Setup
Create the foundations of implementing a tab for printing should be in the form of: print:http://www.google.com I have followed similar approach as what has been done with view-source: and chrome-extension: BUG=173, 947 TEST=none Review URL: http://codereview.chromium.org/150207 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r--chrome/browser/autocomplete/autocomplete.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete.cc b/chrome/browser/autocomplete/autocomplete.cc
index 7678fc7..7b7b1c2 100644
--- a/chrome/browser/autocomplete/autocomplete.cc
+++ b/chrome/browser/autocomplete/autocomplete.cc
@@ -125,7 +125,8 @@ AutocompleteInput::Type AutocompleteInput::Parse(
// should still claim to handle them.
if (LowerCaseEqualsASCII(parsed_scheme, chrome::kViewSourceScheme) ||
LowerCaseEqualsASCII(parsed_scheme, chrome::kJavaScriptScheme) ||
- LowerCaseEqualsASCII(parsed_scheme, chrome::kDataScheme))
+ LowerCaseEqualsASCII(parsed_scheme, chrome::kDataScheme) ||
+ LowerCaseEqualsASCII(parsed_scheme, chrome::kPrintScheme))
return URL;
// Finally, check and see if the user has explicitly opened this scheme as
@@ -257,11 +258,12 @@ void AutocompleteInput::ParseForEmphasizeComponents(
*host = parts.host;
int after_scheme_and_colon = parts.scheme.end() + 1;
- // For the view-source scheme, we should emphasize the scheme and host of
- // the URL qualified by the view-source prefix.
- if (LowerCaseEqualsASCII(scheme_str, chrome::kViewSourceScheme) &&
+ // For the view-source and print schemes, we should emphasize the scheme and
+ // host of the URL qualified by the scheme prefix.
+ if ((LowerCaseEqualsASCII(scheme_str, chrome::kViewSourceScheme) ||
+ LowerCaseEqualsASCII(scheme_str, chrome::kPrintScheme)) &&
(static_cast<int>(text.length()) > after_scheme_and_colon)) {
- // Obtain the URL prefixed by view-source and parse it.
+ // Obtain the URL prefixed by scheme and parse it.
std::wstring real_url(text.substr(after_scheme_and_colon));
url_parse::Parsed real_parts;
AutocompleteInput::Parse(real_url, desired_tld, &real_parts, NULL);