[email protected] | 37cc804 | 2012-02-27 19:32:58 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 93623c5d | 2009-12-10 21:40:32 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "chrome/browser/renderer_preferences_util.h" | ||||
6 | |||||
guidou | ca055a54 | 2016-08-11 11:15:53 | [diff] [blame] | 7 | #include <string> |
8 | |||||
[email protected] | 516b2c73 | 2014-07-25 00:10:31 | [diff] [blame] | 9 | #include "base/macros.h" |
Avi Drissman | 364efc5 | 2018-10-09 23:01:56 | [diff] [blame] | 10 | #include "base/no_destructor.h" |
guidou | ca055a54 | 2016-08-11 11:15:53 | [diff] [blame] | 11 | #include "base/strings/string_number_conversions.h" |
12 | #include "base/strings/string_util.h" | ||||
avi | b896c71 | 2015-12-26 02:10:43 | [diff] [blame] | 13 | #include "build/build_config.h" |
[email protected] | 8ecad5e | 2010-12-02 21:18:33 | [diff] [blame] | 14 | #include "chrome/browser/profiles/profile.h" |
[email protected] | 0a8db0d | 2011-04-13 15:15:40 | [diff] [blame] | 15 | #include "chrome/common/pref_names.h" |
brettw | b1fc1b8 | 2016-02-02 00:19:08 | [diff] [blame] | 16 | #include "components/prefs/pref_service.h" |
[email protected] | daf82f8 | 2011-10-31 22:35:31 | [diff] [blame] | 17 | #include "content/public/common/renderer_preferences.h" |
guoweis | c537ba2 | 2015-11-06 21:20:31 | [diff] [blame] | 18 | #include "content/public/common/webrtc_ip_handling_policy.h" |
Scott Violet | a35f9a4 | 2018-03-22 22:00:44 | [diff] [blame] | 19 | #include "media/media_buildflags.h" |
Blink Reformat | a30d423 | 2018-04-07 15:31:06 | [diff] [blame] | 20 | #include "third_party/blink/public/public_buildflags.h" |
[email protected] | 38a8571 | 2013-01-02 22:45:02 | [diff] [blame] | 21 | #include "third_party/skia/include/core/SkColor.h" |
[email protected] | 93623c5d | 2009-12-10 21:40:32 | [diff] [blame] | 22 | |
[email protected] | 7d076cf5 | 2012-07-09 23:04:47 | [diff] [blame] | 23 | #if defined(OS_LINUX) || defined(OS_ANDROID) |
[email protected] | cd9c65e | 2014-07-10 02:57:01 | [diff] [blame] | 24 | #include "ui/gfx/font_render_params.h" |
[email protected] | f57f6901 | 2012-06-13 02:52:21 | [diff] [blame] | 25 | #endif |
26 | |||||
[email protected] | dbf7501 | 2013-09-24 06:37:25 | [diff] [blame] | 27 | #if defined(TOOLKIT_VIEWS) |
28 | #include "ui/views/controls/textfield/textfield.h" | ||||
[email protected] | 7bd129f | 2012-11-30 02:06:01 | [diff] [blame] | 29 | #endif |
30 | |||||
ellyjones | d0fd7b1 | 2016-08-26 18:26:36 | [diff] [blame] | 31 | #if defined(OS_MACOSX) |
32 | #include "ui/base/cocoa/defaults_utils.h" | ||||
33 | #endif | ||||
34 | |||||
[email protected] | 96514e7 | 2013-09-25 20:42:24 | [diff] [blame] | 35 | #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
36 | #include "chrome/browser/themes/theme_service.h" | ||||
37 | #include "chrome/browser/themes/theme_service_factory.h" | ||||
38 | #include "ui/views/linux_ui/linux_ui.h" | ||||
39 | #endif | ||||
40 | |||||
guidou | ca055a54 | 2016-08-11 11:15:53 | [diff] [blame] | 41 | namespace { |
42 | |||||
43 | // Parses a string |range| with a port range in the form "<min>-<max>". | ||||
44 | // If |range| is not in the correct format or contains an invalid range, zero | ||||
45 | // is written to |min_port| and |max_port|. | ||||
46 | // TODO(guidou): Consider replacing with remoting/protocol/port_range.cc | ||||
47 | void ParsePortRange(const std::string& range, | ||||
48 | uint16_t* min_port, | ||||
49 | uint16_t* max_port) { | ||||
50 | *min_port = 0; | ||||
51 | *max_port = 0; | ||||
52 | |||||