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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTheme.cpp

Issue 1690493002: Switch to LayoutThemeMobile when emulating mobile device in DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more mac compile Created 4 years, 10 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
OLDNEW
1 /** 1 /**
2 * This file is part of the theme implementation for form controls in WebCore. 2 * This file is part of the theme implementation for form controls in WebCore.
3 * 3 *
4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc. 4 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 24 matching lines...) Expand all
35 #include "core/html/HTMLDataListOptionsCollection.h" 35 #include "core/html/HTMLDataListOptionsCollection.h"
36 #include "core/html/HTMLFormControlElement.h" 36 #include "core/html/HTMLFormControlElement.h"
37 #include "core/html/HTMLInputElement.h" 37 #include "core/html/HTMLInputElement.h"
38 #include "core/html/HTMLMeterElement.h" 38 #include "core/html/HTMLMeterElement.h"
39 #include "core/html/HTMLOptionElement.h" 39 #include "core/html/HTMLOptionElement.h"
40 #include "core/html/parser/HTMLParserIdioms.h" 40 #include "core/html/parser/HTMLParserIdioms.h"
41 #include "core/html/shadow/MediaControlElements.h" 41 #include "core/html/shadow/MediaControlElements.h"
42 #include "core/html/shadow/ShadowElementNames.h" 42 #include "core/html/shadow/ShadowElementNames.h"
43 #include "core/html/shadow/SpinButtonElement.h" 43 #include "core/html/shadow/SpinButtonElement.h"
44 #include "core/html/shadow/TextControlInnerElements.h" 44 #include "core/html/shadow/TextControlInnerElements.h"
45 #include "core/layout/LayoutThemeMobile.h"
45 #include "core/page/FocusController.h" 46 #include "core/page/FocusController.h"
46 #include "core/page/Page.h" 47 #include "core/page/Page.h"
47 #include "core/style/ComputedStyle.h" 48 #include "core/style/ComputedStyle.h"
48 #include "platform/FileMetadata.h" 49 #include "platform/FileMetadata.h"
49 #include "platform/FloatConversion.h" 50 #include "platform/FloatConversion.h"
50 #include "platform/RuntimeEnabledFeatures.h" 51 #include "platform/RuntimeEnabledFeatures.h"
51 #include "platform/fonts/FontSelector.h" 52 #include "platform/fonts/FontSelector.h"
52 #include "platform/text/PlatformLocale.h" 53 #include "platform/text/PlatformLocale.h"
53 #include "platform/text/StringTruncator.h" 54 #include "platform/text/StringTruncator.h"
54 #include "public/platform/Platform.h" 55 #include "public/platform/Platform.h"
55 #include "public/platform/WebFallbackThemeEngine.h" 56 #include "public/platform/WebFallbackThemeEngine.h"
56 #include "public/platform/WebRect.h" 57 #include "public/platform/WebRect.h"
57 #include "wtf/text/StringBuilder.h" 58 #include "wtf/text/StringBuilder.h"
58 59
59 #if USE(NEW_THEME) 60 #if USE(NEW_THEME)
60 #include "platform/Theme.h" 61 #include "platform/Theme.h"
61 #endif 62 #endif
62 63
63 // The methods in this file are shared by all themes on every platform. 64 // The methods in this file are shared by all themes on every platform.
64 65
65 namespace blink { 66 namespace blink {
66 67
67 using namespace HTMLNames; 68 using namespace HTMLNames;
68 69
70 LayoutTheme& LayoutTheme::theme()
71 {
72 if (RuntimeEnabledFeatures::mobileLayoutThemeEnabled()) {
73 DEFINE_STATIC_REF(LayoutTheme, layoutThemeMobile, (LayoutThemeMobile::cr eate()));
dgozman 2016/02/11 18:53:44 This is the meaningful part of the patch.
pdr. 2016/02/12 06:36:14 This seems incorrect anytime we share a render pro
dgozman 2016/02/19 19:15:16 I'm aware of this problem, but redesigning away fr
74 return *layoutThemeMobile;
75 }
76 return nativeTheme();
77 }
78
69 LayoutTheme::LayoutTheme() 79 LayoutTheme::LayoutTheme()
70 : m_hasCustomFocusRingColor(false) 80 : m_hasCustomFocusRingColor(false)
71 #if USE(NEW_THEME) 81 #if USE(NEW_THEME)
72 , m_platformTheme(platformTheme()) 82 , m_platformTheme(platformTheme())
73 #endif 83 #endif
74 { 84 {
75 } 85 }
76 86
77 void LayoutTheme::adjustStyle(ComputedStyle& style, Element* e) 87 void LayoutTheme::adjustStyle(ComputedStyle& style, Element* e)
78 { 88 {
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 947
938 // padding - not honored by WinIE, needs to be removed. 948 // padding - not honored by WinIE, needs to be removed.
939 style.resetPadding(); 949 style.resetPadding();
940 950
941 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme) 951 // border - honored by WinIE, but looks terrible (just paints in the control box and turns off the Windows XP theme)
942 // for now, we will not honor it. 952 // for now, we will not honor it.
943 style.resetBorder(); 953 style.resetBorder();
944 } 954 }
945 955
946 } // namespace blink 956 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698