| OLD | NEW |
| 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/common/renderer_preferences.h" | 11 #include "content/public/common/renderer_preferences.h" |
| 12 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
| 13 | 13 |
| 14 #if defined(OS_LINUX) || defined(OS_ANDROID) | 14 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| 15 #include "ui/gfx/font_render_params.h" | 15 #include "ui/gfx/font_render_params.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #if defined(TOOLKIT_VIEWS) | 18 #if defined(TOOLKIT_VIEWS) |
| 19 #include "chrome/browser/defaults.h" | |
| 20 #include "ui/views/controls/textfield/textfield.h" | 19 #include "ui/views/controls/textfield/textfield.h" |
| 21 #endif | 20 #endif |
| 22 | 21 |
| 23 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 22 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 24 #include "chrome/browser/themes/theme_service.h" | 23 #include "chrome/browser/themes/theme_service.h" |
| 25 #include "chrome/browser/themes/theme_service_factory.h" | 24 #include "chrome/browser/themes/theme_service_factory.h" |
| 26 #include "ui/views/linux_ui/linux_ui.h" | 25 #include "ui/views/linux_ui/linux_ui.h" |
| 27 #endif | 26 #endif |
| 28 | 27 |
| 29 namespace renderer_preferences_util { | 28 namespace renderer_preferences_util { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 43 // This color is 0x544d90fe modulated with 0xffffff. | 42 // This color is 0x544d90fe modulated with 0xffffff. |
| 44 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); | 43 prefs->active_selection_bg_color = SkColorSetRGB(0xCB, 0xE4, 0xFA); |
| 45 prefs->active_selection_fg_color = SK_ColorBLACK; | 44 prefs->active_selection_fg_color = SK_ColorBLACK; |
| 46 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); | 45 prefs->inactive_selection_bg_color = SkColorSetRGB(0xEA, 0xEA, 0xEA); |
| 47 prefs->inactive_selection_fg_color = SK_ColorBLACK; | 46 prefs->inactive_selection_fg_color = SK_ColorBLACK; |
| 48 #endif | 47 #endif |
| 49 #endif | 48 #endif |
| 50 | 49 |
| 51 #if defined(TOOLKIT_VIEWS) | 50 #if defined(TOOLKIT_VIEWS) |
| 52 prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0; | 51 prefs->caret_blink_interval = views::Textfield::GetCaretBlinkMs() / 1000.0; |
| 53 if (browser_defaults::kShowLinkDisambiguationPopup) { | |
| 54 prefs->tap_multiple_targets_strategy = | |
| 55 content::TapMultipleTargetsStrategy:: | |
| 56 TAP_MULTIPLE_TARGETS_STRATEGY_POPUP; | |
| 57 } else { | |
| 58 prefs->tap_multiple_targets_strategy = | |
| 59 content::TapMultipleTargetsStrategy::TAP_MULTIPLE_TARGETS_STRATEGY_NONE; | |
| 60 } | |
| 61 #endif | 52 #endif |
| 62 | 53 |
| 63 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) | 54 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 64 views::LinuxUI* linux_ui = views::LinuxUI::instance(); | 55 views::LinuxUI* linux_ui = views::LinuxUI::instance(); |
| 65 if (linux_ui) { | 56 if (linux_ui) { |
| 66 if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) { | 57 if (ThemeServiceFactory::GetForProfile(profile)->UsingSystemTheme()) { |
| 67 prefs->focus_ring_color = linux_ui->GetFocusRingColor(); | 58 prefs->focus_ring_color = linux_ui->GetFocusRingColor(); |
| 68 prefs->thumb_active_color = linux_ui->GetThumbActiveColor(); | 59 prefs->thumb_active_color = linux_ui->GetThumbActiveColor(); |
| 69 prefs->thumb_inactive_color = linux_ui->GetThumbInactiveColor(); | 60 prefs->thumb_inactive_color = linux_ui->GetThumbInactiveColor(); |
| 70 prefs->track_color = linux_ui->GetTrackColor(); | 61 prefs->track_color = linux_ui->GetTrackColor(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 93 prefs->subpixel_rendering = params.subpixel_rendering; | 84 prefs->subpixel_rendering = params.subpixel_rendering; |
| 94 #endif | 85 #endif |
| 95 | 86 |
| 96 #if !defined(OS_MACOSX) | 87 #if !defined(OS_MACOSX) |
| 97 prefs->plugin_fullscreen_allowed = | 88 prefs->plugin_fullscreen_allowed = |
| 98 pref_service->GetBoolean(prefs::kFullscreenAllowed); | 89 pref_service->GetBoolean(prefs::kFullscreenAllowed); |
| 99 #endif | 90 #endif |
| 100 } | 91 } |
| 101 | 92 |
| 102 } // namespace renderer_preferences_util | 93 } // namespace renderer_preferences_util |
| OLD | NEW |