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

Side by Side Diff: Source/core/frame/Settings.h

Issue 146683003: Settings should not call into inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporated review comments Created 6 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
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/Settings.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All rights reserved.
3 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 3 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 #include "core/frame/SettingsDelegate.h" 32 #include "core/frame/SettingsDelegate.h"
33 #include "platform/Timer.h" 33 #include "platform/Timer.h"
34 #include "platform/fonts/GenericFontFamilySettings.h" 34 #include "platform/fonts/GenericFontFamilySettings.h"
35 #include "platform/geometry/IntSize.h" 35 #include "platform/geometry/IntSize.h"
36 #include "platform/weborigin/KURL.h" 36 #include "platform/weborigin/KURL.h"
37 #include "wtf/HashSet.h" 37 #include "wtf/HashSet.h"
38 #include "wtf/RefCounted.h" 38 #include "wtf/RefCounted.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 class Page; // For inspector, remove after http://crbug.com/327476
43
44 enum EditableLinkBehavior { 42 enum EditableLinkBehavior {
45 EditableLinkDefaultBehavior, 43 EditableLinkDefaultBehavior,
46 EditableLinkAlwaysLive, 44 EditableLinkAlwaysLive,
47 EditableLinkOnlyLiveWithShiftKey, 45 EditableLinkOnlyLiveWithShiftKey,
48 EditableLinkLiveWhenNotFocused, 46 EditableLinkLiveWhenNotFocused,
49 EditableLinkNeverLive 47 EditableLinkNeverLive
50 }; 48 };
51 49
52 class Settings { 50 class Settings {
53 WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED; 51 WTF_MAKE_NONCOPYABLE(Settings); WTF_MAKE_FAST_ALLOCATED;
54 public: 52 public:
55 static PassOwnPtr<Settings> create(); 53 static PassOwnPtr<Settings> create();
56 54
57 GenericFontFamilySettings& genericFontFamilySettings() { return m_genericFon tFamilySettings; } 55 GenericFontFamilySettings& genericFontFamilySettings() { return m_genericFon tFamilySettings; }
58 56
59 void setTextAutosizingEnabled(bool); 57 void setTextAutosizingEnabled(bool);
60 bool textAutosizingEnabled() const; 58 bool textAutosizingEnabled() const { return m_textAutosizingEnabled; }
61
62 // Compensates for poor text legibility on mobile devices. This value is
63 // multiplied by the font scale factor when performing text autosizing of
64 // websites that do not set an explicit viewport description.
65 void setDeviceScaleAdjustment(float);
66 float deviceScaleAdjustment() const;
67 59
68 // Only set by Layout Tests, and only used if textAutosizingEnabled() return s true. 60 // Only set by Layout Tests, and only used if textAutosizingEnabled() return s true.
69 void setTextAutosizingWindowSizeOverride(const IntSize&); 61 void setTextAutosizingWindowSizeOverride(const IntSize&);
70 const IntSize& textAutosizingWindowSizeOverride() const { return m_textAutos izingWindowSizeOverride; } 62 const IntSize& textAutosizingWindowSizeOverride() const { return m_textAutos izingWindowSizeOverride; }
71 63
72 // Clients that execute script should call ScriptController::canExecuteScrip ts()
73 // instead of this function. ScriptController::canExecuteScripts() checks th e
74 // HTML sandbox, plug-in sandboxing, and other important details.
75 bool isScriptEnabled() const { return m_isScriptEnabled; }
76 void setScriptEnabled(bool);
77
78 SETTINGS_GETTERS_AND_SETTERS 64 SETTINGS_GETTERS_AND_SETTERS
79 65
80 // FIXME: This does not belong here. 66 // FIXME: This does not belong here.
81 static void setMockScrollbarsEnabled(bool flag); 67 static void setMockScrollbarsEnabled(bool flag);
82 static bool mockScrollbarsEnabled(); 68 static bool mockScrollbarsEnabled();
83 69
84 // FIXME: naming_utilities.py isn't smart enough to handle OpenGL yet. 70 // FIXME: naming_utilities.py isn't smart enough to handle OpenGL yet.
85 // It could handle "GL", but that seems a bit overly broad. 71 // It could handle "GL", but that seems a bit overly broad.
86 void setOpenGLMultisamplingEnabled(bool flag); 72 void setOpenGLMultisamplingEnabled(bool flag);
87 bool openGLMultisamplingEnabled() { return m_openGLMultisamplingEnabled; } 73 bool openGLMultisamplingEnabled() { return m_openGLMultisamplingEnabled; }
88 74
89 void setDelegate(SettingsDelegate*); 75 void setDelegate(SettingsDelegate*);
90 76
91 private: 77 private:
92 Settings(); 78 Settings();
93 79
94 void invalidate(SettingsDelegate::ChangeType); 80 void invalidate(SettingsDelegate::ChangeType);
95 81
96 // FIXME: pageOfShame() is a hack for the inspector code:
97 // http://crbug.com/327476
98 Page* pageOfShame() const;
99
100 SettingsDelegate* m_delegate; 82 SettingsDelegate* m_delegate;
101 83
102 GenericFontFamilySettings m_genericFontFamilySettings; 84 GenericFontFamilySettings m_genericFontFamilySettings;
103 float m_deviceScaleAdjustment; 85 bool m_openGLMultisamplingEnabled : 1;
104 IntSize m_textAutosizingWindowSizeOverride; 86 IntSize m_textAutosizingWindowSizeOverride;
105 bool m_textAutosizingEnabled : 1; 87 bool m_textAutosizingEnabled : 1;
106 88
107 SETTINGS_MEMBER_VARIABLES 89 SETTINGS_MEMBER_VARIABLES
108
109 bool m_isScriptEnabled : 1;
110 bool m_openGLMultisamplingEnabled : 1;
111 }; 90 };
112 91
113 } // namespace WebCore 92 } // namespace WebCore
114 93
115 #endif // Settings_h 94 #endif // Settings_h
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/frame/Settings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698