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

Side by Side Diff: chrome/browser/renderer_preferences_util.cc

Issue 2351553002: Fix "defined but not used" build error when enable_webrtc=false. (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer_preferences_util.h" 5 #include "chrome/browser/renderer_preferences_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 18 matching lines...) Expand all
29 #if defined(OS_MACOSX) 29 #if defined(OS_MACOSX)
30 #include "ui/base/cocoa/defaults_utils.h" 30 #include "ui/base/cocoa/defaults_utils.h"
31 #endif 31 #endif
32 32
33 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) 33 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
34 #include "chrome/browser/themes/theme_service.h" 34 #include "chrome/browser/themes/theme_service.h"
35 #include "chrome/browser/themes/theme_service_factory.h" 35 #include "chrome/browser/themes/theme_service_factory.h"
36 #include "ui/views/linux_ui/linux_ui.h" 36 #include "ui/views/linux_ui/linux_ui.h"
37 #endif 37 #endif
38 38
39 #if defined(ENABLE_WEBRTC)
39 namespace { 40 namespace {
40 41
41 // Parses a string |range| with a port range in the form "<min>-<max>". 42 // Parses a string |range| with a port range in the form "<min>-<max>".
42 // If |range| is not in the correct format or contains an invalid range, zero 43 // If |range| is not in the correct format or contains an invalid range, zero
43 // is written to |min_port| and |max_port|. 44 // is written to |min_port| and |max_port|.
44 // TODO(guidou): Consider replacing with remoting/protocol/port_range.cc 45 // TODO(guidou): Consider replacing with remoting/protocol/port_range.cc
45 void ParsePortRange(const std::string& range, 46 void ParsePortRange(const std::string& range,
46 uint16_t* min_port, 47 uint16_t* min_port,
47 uint16_t* max_port) { 48 uint16_t* max_port) {
48 *min_port = 0; 49 *min_port = 0;
(...skipping 19 matching lines...) Expand all
68 if (min_port_uint == 0 || min_port_uint > max_port_uint || 69 if (min_port_uint == 0 || min_port_uint > max_port_uint ||
69 max_port_uint > UINT16_MAX) { 70 max_port_uint > UINT16_MAX) {
70 return; 71 return;
71 } 72 }
72 73
73 *min_port = static_cast<uint16_t>(min_port_uint); 74 *min_port = static_cast<uint16_t>(min_port_uint);
74 *max_port = static_cast<uint16_t>(max_port_uint); 75 *max_port = static_cast<uint16_t>(max_port_uint);
75 } 76 }
76 77
77 } // namespace 78 } // namespace
79 #endif
78 80
79 namespace renderer_preferences_util { 81 namespace renderer_preferences_util {
80 82
81 void UpdateFromSystemSettings(content::RendererPreferences* prefs, 83 void UpdateFromSystemSettings(content::RendererPreferences* prefs,
82 Profile* profile, 84 Profile* profile,
83 content::WebContents* web_contents) { 85 content::WebContents* web_contents) {
84 const PrefService* pref_service = profile->GetPrefs(); 86 const PrefService* pref_service = profile->GetPrefs();
85 prefs->accept_languages = pref_service->GetString(prefs::kAcceptLanguages); 87 prefs->accept_languages = pref_service->GetString(prefs::kAcceptLanguages);
86 prefs->enable_referrers = pref_service->GetBoolean(prefs::kEnableReferrers); 88 prefs->enable_referrers = pref_service->GetBoolean(prefs::kEnableReferrers);
87 prefs->enable_do_not_track = 89 prefs->enable_do_not_track =
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 prefs->subpixel_rendering = params.subpixel_rendering; 165 prefs->subpixel_rendering = params.subpixel_rendering;
164 #endif 166 #endif
165 167
166 #if !defined(OS_MACOSX) 168 #if !defined(OS_MACOSX)
167 prefs->plugin_fullscreen_allowed = 169 prefs->plugin_fullscreen_allowed =
168 pref_service->GetBoolean(prefs::kFullscreenAllowed); 170 pref_service->GetBoolean(prefs::kFullscreenAllowed);
169 #endif 171 #endif
170 } 172 }
171 173
172 } // namespace renderer_preferences_util 174 } // namespace renderer_preferences_util
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698