Changeset 55673 in webkit


Ignore:
Timestamp:
Mar 8, 2010 11:22:44 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-08 Stuart Morgan <stuartmorgan@chromium.org>

Reviewed by Darin Adler.

Added a new USE definition for secure text mode on the Mac.
https://bugs.webkit.org/show_bug.cgi?id=31265

  • wtf/Platform.h:

2010-03-08 Stuart Morgan <stuartmorgan@chromium.org>

Reviewed by Darin Adler.

Move the details of secure text mode into WebCore/platform.
Move the higher-level logic for secure text mode from Frame
to SelectionController.

https://bugs.webkit.org/show_bug.cgi?id=31265

No new tests: no functional changes.

  • WebCore.gypi:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/Document.cpp: (WebCore::Document::setUseSecureKeyboardEntryWhenActive):
  • editing/SelectionController.cpp: (WebCore::SelectionController::focusedOrActiveStateChanged): (WebCore::SelectionController::updateSecureKeyboardEntryIfActive): (WebCore::SelectionController::setUseSecureKeyboardEntry):
  • editing/SelectionController.h:
  • page/Frame.cpp: (WebCore::Frame::setDocument):
  • page/Frame.h:
  • platform/SecureTextInput.cpp: Added. (WebCore::enableSecureTextInput): (WebCore::disableSecureTextInput):
  • platform/SecureTextInput.h: Added. (WebCore::enableSecureTextInput): (WebCore::disableSecureTextInput):
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r55670 r55673  
     12010-03-08  Stuart Morgan  <stuartmorgan@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Added a new USE definition for secure text mode on the Mac.
     6        https://bugs.webkit.org/show_bug.cgi?id=31265
     7
     8        * wtf/Platform.h:
     9
    1102010-03-08  Jian Li  <jianli@chromium.org>
    211
  • trunk/JavaScriptCore/wtf/Platform.h

    r55500 r55673  
    580580#endif /* PLATFORM(MAC) && !PLATFORM(IPHONE) */
    581581
     582#if PLATFORM(MAC)
     583#define WTF_USE_CARBON_SECURE_INPUT_MODE 1
     584#endif
     585
    582586#if PLATFORM(CHROMIUM) && OS(DARWIN)
    583587#define WTF_PLATFORM_CF 1
    584588#define WTF_USE_PTHREADS 1
    585589#define HAVE_PTHREAD_RWLOCK 1
     590#define WTF_USE_CARBON_SECURE_INPUT_MODE 1
    586591#endif
    587592
  • trunk/WebCore/ChangeLog

    r55672 r55673  
     12010-03-08  Stuart Morgan  <stuartmorgan@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Move the details of secure text mode into WebCore/platform.
     6        Move the higher-level logic for secure text mode from Frame
     7        to SelectionController.
     8
     9        https://bugs.webkit.org/show_bug.cgi?id=31265
     10
     11        No new tests: no functional changes.
     12
     13        * WebCore.gypi:
     14        * WebCore.xcodeproj/project.pbxproj:
     15        * dom/Document.cpp:
     16        (WebCore::Document::setUseSecureKeyboardEntryWhenActive):
     17        * editing/SelectionController.cpp:
     18        (WebCore::SelectionController::focusedOrActiveStateChanged):
     19        (WebCore::SelectionController::updateSecureKeyboardEntryIfActive):
     20        (WebCore::SelectionController::setUseSecureKeyboardEntry):
     21        * editing/SelectionController.h:
     22        * page/Frame.cpp:
     23        (WebCore::Frame::setDocument):
     24        * page/Frame.h:
     25        * platform/SecureTextInput.cpp: Added.
     26        (WebCore::enableSecureTextInput):
     27        (WebCore::disableSecureTextInput):
     28        * platform/SecureTextInput.h: Added.
     29        (WebCore::enableSecureTextInput):
     30        (WebCore::disableSecureTextInput):
     31
    1322010-03-08  Brady Eidson  <beidson@apple.com>
    233
  • trunk/WebCore/WebCore.gypi

    r55635 r55673  
    28612861            'platform/ScrollbarThemeComposite.h',
    28622862            'platform/SearchPopupMenu.h',
     2863            'platform/SecureTextInput.cpp',
     2864            'platform/SecureTextInput.h',
    28632865            'platform/SharedBuffer.cpp',
    28642866            'platform/SharedBuffer.h',
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r55638 r55673  
    681681                3390CA560FFC157B00921962 /* NotificationCenter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA520FFC157B00921962 /* NotificationCenter.h */; };
    682682                3390CA580FFC157B00921962 /* NotificationContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA540FFC157B00921962 /* NotificationContents.h */; };
     683                33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */; };
     684                33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */; };
    683685                371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
    684686                371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; };
     
    60526054                3390CA530FFC157B00921962 /* NotificationCenter.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NotificationCenter.idl; path = notifications/NotificationCenter.idl; sourceTree = "<group>"; };
    60536055                3390CA540FFC157B00921962 /* NotificationContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationContents.h; path = notifications/NotificationContents.h; sourceTree = "<group>"; };
     6056                33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecureTextInput.cpp; sourceTree = "<group>"; };
     6057                33C0CCD3112C5E6200CE057D /* SecureTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextInput.h; sourceTree = "<group>"; };
    60546058                371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; };
    60556059                371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; };
     
    1532015324                                BC6D6E2509AF943500F59759 /* ScrollView.h */,
    1532115325                                AB7170880B3118080017123E /* SearchPopupMenu.h */,
     15326                                33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */,
     15327                                33C0CCD3112C5E6200CE057D /* SecureTextInput.h */,
    1532215328                                1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */,
    1532315329                                1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */,
     
    1864618652                                9F2A322C1125A0A2003C3056 /* JavaScriptProfile.h in Headers */,
    1864718653                                9F2A322E1125A0A2003C3056 /* JavaScriptProfileNode.h in Headers */,
     18654                                33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */,
    1864818655                                7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */,
    1864918656                                7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */,
     
    2084720854                                9F2A322B1125A0A2003C3056 /* JavaScriptProfile.cpp in Sources */,
    2084820855                                9F2A322D1125A0A2003C3056 /* JavaScriptProfileNode.cpp in Sources */,
     20856                                33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */,
    2084920857                                6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */,
    2085020858                                6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */,
  • trunk/WebCore/dom/Document.cpp

    r55635 r55673  
    43814381       
    43824382    m_useSecureKeyboardEntryWhenActive = usesSecureKeyboard;
    4383     m_frame->updateSecureKeyboardEntryIfActive();
     4383    m_frame->selection()->updateSecureKeyboardEntryIfActive();
    43844384}
    43854385
  • trunk/WebCore/editing/SelectionController.cpp

    r55669 r55673  
    4848#include "RenderTheme.h"
    4949#include "RenderView.h"
     50#include "SecureTextInput.h"
    5051#include "Settings.h"
    5152#include "TextIterator.h"
     
    13221323    // Secure keyboard entry is set by the active frame.
    13231324    if (m_frame->document()->useSecureKeyboardEntryWhenActive())
    1324         m_frame->setUseSecureKeyboardEntry(activeAndFocused);
     1325        setUseSecureKeyboardEntry(activeAndFocused);
    13251326}
    13261327
     
    13281329{
    13291330    focusedOrActiveStateChanged();
     1331}
     1332
     1333void SelectionController::updateSecureKeyboardEntryIfActive()
     1334{
     1335    if (m_frame->document() && isFocusedAndActive())
     1336        setUseSecureKeyboardEntry(m_frame->document()->useSecureKeyboardEntryWhenActive());
     1337}
     1338
     1339void SelectionController::setUseSecureKeyboardEntry(bool enable)
     1340{
     1341    if (enable)
     1342        enableSecureTextInput();
     1343    else
     1344        disableSecureTextInput();
    13301345}
    13311346
  • trunk/WebCore/editing/SelectionController.h

    r55669 r55673  
    132132    void updateAppearance();
    133133
     134    void updateSecureKeyboardEntryIfActive();
     135
    134136#ifndef NDEBUG
    135137    void formatForDebugger(char* buffer, unsigned length) const;
     
    169171
    170172    void caretBlinkTimerFired(Timer<SelectionController>*);
     173
     174    void setUseSecureKeyboardEntry(bool);
    171175
    172176    Frame* m_frame;
  • trunk/WebCore/page/Frame.cpp

    r55387 r55673  
    8585#include <wtf/StdLibExtras.h>
    8686
    87 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    88 #import <Carbon/Carbon.h>
    89 #endif
    90 
    9187#if USE(JSC)
    9288#include "JSDOMWindowShell.h"
     
    282278
    283279    m_doc = newDoc;
    284     if (m_doc && selection()->isFocusedAndActive())
    285         setUseSecureKeyboardEntry(m_doc->useSecureKeyboardEntryWhenActive());
     280    selection()->updateSecureKeyboardEntryIfActive();
    286281
    287282    if (m_doc && !m_doc->attached())
     
    843838}
    844839
    845 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    846 const short enableRomanKeyboardsOnly = -23;
    847 #endif
    848 void Frame::setUseSecureKeyboardEntry(bool enable)
    849 {
    850 #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN))
    851     if (enable == IsSecureEventInputEnabled())
    852         return;
    853     if (enable) {
    854         EnableSecureEventInput();
    855 #ifdef BUILDING_ON_TIGER
    856         KeyScript(enableRomanKeyboardsOnly);
    857 #else
    858         // WebKit substitutes nil for input context when in password field, which corresponds to null TSMDocument. So, there is
    859         // no need to call TSMGetActiveDocument(), which may return an incorrect result when selection hasn't been yet updated
    860         // after focusing a node.
    861         CFArrayRef inputSources = TISCreateASCIICapableInputSourceList();
    862         TSMSetDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources);
    863         CFRelease(inputSources);
    864 #endif
    865     } else {
    866         DisableSecureEventInput();
    867 #ifdef BUILDING_ON_TIGER
    868         KeyScript(smKeyEnableKybds);
    869 #else
    870         TSMRemoveDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag);
    871 #endif
    872     }
    873 #endif
    874 }
    875 
    876 void Frame::updateSecureKeyboardEntryIfActive()
    877 {
    878     if (selection()->isFocusedAndActive())
    879         setUseSecureKeyboardEntry(m_doc->useSecureKeyboardEntryWhenActive());
    880 }
    881 
    882840CSSMutableStyleDeclaration *Frame::typingStyle() const
    883841{
  • trunk/WebCore/page/Frame.h

    r55387 r55673  
    245245        bool isContentEditable() const; // if true, everything in frame is editable
    246246
    247         void updateSecureKeyboardEntryIfActive();
    248 
    249247        CSSMutableStyleDeclaration* typingStyle() const;
    250248        void setTypingStyle(CSSMutableStyleDeclaration*);
     
    259257        void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
    260258        void setSelectionFromNone();
    261 
    262         void setUseSecureKeyboardEntry(bool);
    263259
    264260        SelectionController* dragCaretController() const;
Note: See TracChangeset for help on using the changeset viewer.