blob: bfaec640fadb6f0c92001a5d6d401d9d04092ace [file] [log] [blame]
[email protected]37cc8042012-02-27 19:32:581// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]93623c5d2009-12-10 21:40:322// 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
guidouca055a542016-08-11 11:15:537#include <string>
8
[email protected]516b2c732014-07-25 00:10:319#include "base/macros.h"
Avi Drissman364efc52018-10-09 23:01:5610#include "base/no_destructor.h"
guidouca055a542016-08-11 11:15:5311#include "base/strings/string_number_conversions.h"
12#include "base/strings/string_util.h"
avib896c712015-12-26 02:10:4313#include "build/build_config.h"
[email protected]8ecad5e2010-12-02 21:18:3314#include "chrome/browser/profiles/profile.h"
[email protected]0a8db0d2011-04-13 15:15:4015#include "chrome/common/pref_names.h"
brettwb1fc1b82016-02-02 00:19:0816#include "components/prefs/pref_service.h"
[email protected]daf82f82011-10-31 22:35:3117#include "content/public/common/renderer_preferences.h"
guoweisc537ba22015-11-06 21:20:3118#include "content/public/common/webrtc_ip_handling_policy.h"
Scott Violeta35f9a42018-03-22 22:00:4419#include "media/media_buildflags.h"
Blink Reformata30d4232018-04-07 15:31:0620#include "third_party/blink/public/public_buildflags.h"
[email protected]38a85712013-01-02 22:45:0221#include "third_party/skia/include/core/SkColor.h"
[email protected]93623c5d2009-12-10 21:40:3222
[email protected]7d076cf52012-07-09 23:04:4723#if defined(OS_LINUX) || defined(OS_ANDROID)
[email protected]cd9c65e2014-07-10 02:57:0124#include "ui/gfx/font_render_params.h"
[email protected]f57f69012012-06-13 02:52:2125#endif
26
[email protected]dbf75012013-09-24 06:37:2527#if defined(TOOLKIT_VIEWS)
28#include "ui/views/controls/textfield/textfield.h"
[email protected]7bd129f2012-11-30 02:06:0129#endif
30
ellyjonesd0fd7b12016-08-26 18:26:3631#if defined(OS_MACOSX)
32#include "ui/base/cocoa/defaults_utils.h"
33#endif
34
[email protected]96514e72013-09-25 20:42:2435#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
guidouca055a542016-08-11 11:15:5341namespace {
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
47void ParsePortRange(const std::string& range,
48 uint16_t* min_port,
49 uint16_t* max_port) {
50 *min_port = 0;
51 *max_port = 0;
52