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

Side by Side Diff: third_party/WebKit/Source/core/page/FocusController.h

Issue 1423053002: Make document.activeElement work with OOPIF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-preserve-page-focus-on-subframe-navigations
Patch Set: Change plumbing a bit: use focusDocumentView on WebView and remove clearFocus from WebLocalFrame Created 5 years, 1 month 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 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 class Page; 45 class Page;
46 46
47 class CORE_EXPORT FocusController final : public NoBaseWillBeGarbageCollectedFin alized<FocusController> { 47 class CORE_EXPORT FocusController final : public NoBaseWillBeGarbageCollectedFin alized<FocusController> {
48 WTF_MAKE_NONCOPYABLE(FocusController); USING_FAST_MALLOC_WILL_BE_REMOVED(Foc usController); 48 WTF_MAKE_NONCOPYABLE(FocusController); USING_FAST_MALLOC_WILL_BE_REMOVED(Foc usController);
49 public: 49 public:
50 static PassOwnPtrWillBeRawPtr<FocusController> create(Page*); 50 static PassOwnPtrWillBeRawPtr<FocusController> create(Page*);
51 51
52 void setFocusedFrame(PassRefPtrWillBeRawPtr<Frame>); 52 void setFocusedFrame(PassRefPtrWillBeRawPtr<Frame>);
53 void focusDocumentView(PassRefPtrWillBeRawPtr<Frame>); 53 void focusDocumentView(PassRefPtrWillBeRawPtr<Frame>);
54 LocalFrame* focusedFrame() const; 54 LocalFrame* focusedFrame() const;
55 Frame* focusedFrameEvenIfRemote() const { return m_focusedFrame.get(); }
dcheng 2015/11/04 01:46:21 Crazy idea: can we move the logic for determining
alexmos 2015/11/04 18:08:12 I like this - done! Please take a look.
55 Frame* focusedOrMainFrame() const; 56 Frame* focusedOrMainFrame() const;
56 57
57 bool setInitialFocus(WebFocusType); 58 bool setInitialFocus(WebFocusType);
58 bool advanceFocus(WebFocusType type, InputDeviceCapabilities* sourceCapabili ties = nullptr) { return advanceFocus(type, false, sourceCapabilities); } 59 bool advanceFocus(WebFocusType type, InputDeviceCapabilities* sourceCapabili ties = nullptr) { return advanceFocus(type, false, sourceCapabilities); }
59 Element* findFocusableElement(WebFocusType, Node&); 60 Element* findFocusableElement(WebFocusType, Node&);
60 61
61 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>, WebFocusType = WebFocusTypeNone, InputDeviceCapabilities* sourceCapabilities = nullptr); 62 bool setFocusedElement(Element*, PassRefPtrWillBeRawPtr<Frame>, WebFocusType = WebFocusTypeNone, InputDeviceCapabilities* sourceCapabilities = nullptr);
62 63
63 void setActive(bool); 64 void setActive(bool);
64 bool isActive() const { return m_isActive; } 65 bool isActive() const { return m_isActive; }
(...skipping 16 matching lines...) Expand all
81 RawPtrWillBeMember<Page> m_page; 82 RawPtrWillBeMember<Page> m_page;
82 RefPtrWillBeMember<Frame> m_focusedFrame; 83 RefPtrWillBeMember<Frame> m_focusedFrame;
83 bool m_isActive; 84 bool m_isActive;
84 bool m_isFocused; 85 bool m_isFocused;
85 bool m_isChangingFocusedFrame; 86 bool m_isChangingFocusedFrame;
86 }; 87 };
87 88
88 } // namespace blink 89 } // namespace blink
89 90
90 #endif // FocusController_h 91 #endif // FocusController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698