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

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

Issue 725243002: add flag to disable link disambiguation popup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add histogram.xml entry for flag Created 6 years 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
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 "base/macros.h" 7 #include "base/macros.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "content/public/browser/host_zoom_map.h" 11 #include "content/public/browser/host_zoom_map.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 #include "content/public/common/renderer_preferences.h" 13 #include "content/public/common/renderer_preferences.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 15
16 #if defined(OS_LINUX) || defined(OS_ANDROID) 16 #if defined(OS_LINUX) || defined(OS_ANDROID)
17 #include "ui/gfx/font_render_params.h" 17 #include "ui/gfx/font_render_params.h"
18 #endif 18 #endif
19 19
20 #if !defined(OS_ANDROID) 20 #if !defined(OS_ANDROID)
21 #include "chrome/browser/ui/zoom/zoom_controller.h" 21 #include "chrome/browser/ui/zoom/zoom_controller.h"
22 #endif 22 #endif
23 23
24 #if defined(TOOLKIT_VIEWS) 24 #if defined(TOOLKIT_VIEWS)
25 #include "chrome/browser/defaults.h"
26 #include "ui/views/controls/textfield/textfield.h" 25 #include "ui/views/controls/textfield/textfield.h"
27 #endif 26 #endif
28 27
29 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) 28 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
30 #include "chrome/browser/themes/theme_service.h" 29 #include "chrome/browser/themes/theme_service.h"
31 #include "chrome/browser/themes/theme_service_factory.h" 30 #include "chrome/browser/themes/theme_service_factory.h"
32 #include "ui/views/linux_ui/linux_ui.h" 31 #include "ui/views/linux_ui/linux_ui.h"
33 #endif 32 #endif
34 33
35 namespace renderer_preferences_util { 34 namespace renderer_preferences_util {
(...skipping 27 matching lines...) Expand all
63 // This color is 0x544d90fe modulated with 0xffffff. 62 // This color is 0x544d90fe modulated with 0xffffff.
64 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); 63 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA);
65 prefs->active_selection_fg_color = SK_ColorBLACK; 64 prefs->active_selection_fg_color = SK_ColorBLACK;
66 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); 65 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA);
67 prefs->inactive_selection_fg_color = SK_ColorBLACK; 66 prefs->inactive_selection_fg_color = SK_ColorBLACK;
68 #endif 67 #endif
69 #endif 68 #endif
70 69
71 #if defined(TOOLKIT_VIEWS) 70 #if defined(TOOLKIT_VIEWS)
72 prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0; 71 prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0;
73 if (browser_defaults::kShowLinkDisambiguationPopup) {
74 prefs->tap_multiple_targets_strategy =
75 content::TapMultipleTargetsStrategy::
76 TAP_MULTIPLE_TARGETS_STRATEGY_POPUP;
77 } else {
78 prefs->tap_multiple_targets_strategy =
79 content::TapMultipleTargetsStrategy::TAP_MULTIPLE_TARGETS_STRATEGY_NONE;
80 }
81 #endif 72 #endif
82 73
83 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) 74 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
84 views::LinuxUI* linux_ui = views::LinuxUI::instance(); 75 views::LinuxUI* linux_ui = views::LinuxUI::instance();
85 if (linux_ui) { 76 if (linux_ui) {
86 if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) { 77 if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) {
87 prefs->focus_ring_color = linux_ui->GetFocusRingColor(); 78 prefs->focus_ring_color = linux_ui->GetFocusRingColor();
88 prefs->thumb_active_color = linux_ui->GetThumbActiveColor(); 79 prefs->thumb_active_color = linux_ui->GetThumbActiveColor();
89 prefs->thumb_inactive_color = linux_ui->GetThumbInactiveColor(); 80 prefs->thumb_inactive_color = linux_ui->GetThumbInactiveColor();
90 prefs->track_color = linux_ui->GetTrackColor(); 81 prefs->track_color = linux_ui->GetTrackColor();
(...skipping 22 matching lines...) Expand all
113 prefs->subpixel_rendering = params.subpixel_rendering; 104 prefs->subpixel_rendering = params.subpixel_rendering;
114 #endif 105 #endif
115 106
116 #if !defined(OS_MACOSX) 107 #if !defined(OS_MACOSX)
117 prefs->plugin_fullscreen_allowed = 108 prefs->plugin_fullscreen_allowed =
118 pref_service->GetBoolean(prefs::kFullscreenAllowed); 109 pref_service->GetBoolean(prefs::kFullscreenAllowed);
119 #endif 110 #endif
120 } 111 }
121 112
122 } // namespace renderer_preferences_util 113 } // namespace renderer_preferences_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698