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

Side by Side Diff: chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc

Issue 2623033006: [Re-landing] Migrate external protocol prefs from local state to profiles (Closed)
Patch Set: rebase Created 3 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
« no previous file with comments | « no previous file | chrome/browser/chrome_site_per_process_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/autocomplete/chrome_autocomplete_scheme_classifier.h" 5 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 8 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
9 #include "chrome/browser/external_protocol/external_protocol_handler.h" 9 #include "chrome/browser/external_protocol/external_protocol_handler.h"
10 #include "chrome/browser/profiles/profile_io_data.h" 10 #include "chrome/browser/profiles/profile_io_data.h"
(...skipping 27 matching lines...) Expand all
38 return metrics::OmniboxInputType::URL; 38 return metrics::OmniboxInputType::URL;
39 39
40 // Not an internal protocol; check if it's an external protocol, i.e. one 40 // Not an internal protocol; check if it's an external protocol, i.e. one
41 // that's registered on the user's OS and will shell out to another program. 41 // that's registered on the user's OS and will shell out to another program.
42 // 42 //
43 // We need to do this after the checks above because some internally 43 // We need to do this after the checks above because some internally
44 // handlable schemes (e.g. "javascript") may be treated as "blocked" by the 44 // handlable schemes (e.g. "javascript") may be treated as "blocked" by the
45 // external protocol handler because we don't want pages to open them, but 45 // external protocol handler because we don't want pages to open them, but
46 // users still can. 46 // users still can.
47 const ExternalProtocolHandler::BlockState block_state = 47 const ExternalProtocolHandler::BlockState block_state =
48 ExternalProtocolHandler::GetBlockState(scheme); 48 ExternalProtocolHandler::GetBlockState(scheme, profile_);
49 switch (block_state) { 49 switch (block_state) {
50 case ExternalProtocolHandler::DONT_BLOCK: 50 case ExternalProtocolHandler::DONT_BLOCK:
51 return metrics::OmniboxInputType::URL; 51 return metrics::OmniboxInputType::URL;
52 52
53 case ExternalProtocolHandler::BLOCK: 53 case ExternalProtocolHandler::BLOCK:
54 // If we don't want the user to open the URL, don't let it be navigated 54 // If we don't want the user to open the URL, don't let it be navigated
55 // to at all. 55 // to at all.
56 return metrics::OmniboxInputType::QUERY; 56 return metrics::OmniboxInputType::QUERY;
57 57
58 default: 58 default:
59 return metrics::OmniboxInputType::INVALID; 59 return metrics::OmniboxInputType::INVALID;
60 } 60 }
61 } 61 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698