summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl/cpwl_wnd.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-10-17 09:08:26 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-10-17 14:30:31 +0000
commit6dc4fb899acfee6261a44cde8015b5c8f3eb75a3 (patch)
tree712f5b8e4e943ec6b8a36c979444a48189a7f8a0 /fpdfsdk/pwl/cpwl_wnd.cpp
parent38ce5278ad391b66716425788b45a0bfa2331412 (diff)
downloadpdfium-6dc4fb899acfee6261a44cde8015b5c8f3eb75a3.tar.xz
Remove friends from PWL classes
This CL removes the friend entries from the various pwl/ classes. Change-Id: Ib93a2bedcde521eb92e53580b5d7cd9bca08902f Reviewed-on: https://pdfium-review.googlesource.com/16150 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_wnd.cpp')
-rw-r--r--fpdfsdk/pwl/cpwl_wnd.cpp28
1 files changed, 5 insertions, 23 deletions
diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
index ec605a3844..368db74ec4 100644
--- a/fpdfsdk/pwl/cpwl_wnd.cpp
+++ b/fpdfsdk/pwl/cpwl_wnd.cpp
@@ -47,31 +47,14 @@ CPWL_Wnd::CreateParams::CreateParams(const CreateParams& other) = default;
CPWL_Wnd::CreateParams::~CreateParams() = default;
class CPWL_MsgControl : public Observable<CPWL_MsgControl> {
- friend class CPWL_Wnd;
-
public:
- explicit CPWL_MsgControl(CPWL_Wnd* pWnd) {
- m_pCreatedWnd = pWnd;
- Default();
- }
-
- ~CPWL_MsgControl() { Default(); }
-
- void Default() {
- m_aMousePath.clear();
- m_aKeyboardPath.clear();
- m_pMainMouseWnd = nullptr;
- m_pMainKeyboardWnd = nullptr;
- }
+ explicit CPWL_MsgControl(CPWL_Wnd* pWnd) : m_pCreatedWnd(pWnd) {}
+ ~CPWL_MsgControl() {}
bool IsWndCreated(const CPWL_Wnd* pWnd) const {
return m_pCreatedWnd == pWnd;
}
- bool IsMainCaptureMouse(const CPWL_Wnd* pWnd) const {
- return pWnd == m_pMainMouseWnd;
- }
-
bool IsWndCaptureMouse(const CPWL_Wnd* pWnd) const {
return pWnd && pdfium::ContainsValue(m_aMousePath, pWnd);
}
@@ -114,7 +97,6 @@ class CPWL_MsgControl : public Observable<CPWL_MsgControl> {
void SetCapture(CPWL_Wnd* pWnd) {
m_aMousePath.clear();
if (pWnd) {
- m_pMainMouseWnd = pWnd;
CPWL_Wnd* pParent = pWnd;
while (pParent) {
m_aMousePath.push_back(pParent);
@@ -124,15 +106,15 @@ class CPWL_MsgControl : public Observable<CPWL_MsgControl> {
}
void ReleaseCapture() {
- m_pMainMouseWnd = nullptr;
m_aMousePath.clear();
}
+ CPWL_Wnd* GetFocusedWindow() const { return m_pMainKeyboardWnd.Get(); }
+
private:
std::vector<CPWL_Wnd*> m_aMousePath;
std::vector<CPWL_Wnd*> m_aKeyboardPath;
UnownedPtr<CPWL_Wnd> m_pCreatedWnd;
- UnownedPtr<CPWL_Wnd> m_pMainMouseWnd;
UnownedPtr<CPWL_Wnd> m_pMainKeyboardWnd;
};
@@ -804,7 +786,7 @@ void CPWL_Wnd::SetChildMatrix(const CFX_Matrix& mt) {
const CPWL_Wnd* CPWL_Wnd::GetFocused() const {
CPWL_MsgControl* pMsgCtrl = GetMsgControl();
- return pMsgCtrl ? pMsgCtrl->m_pMainKeyboardWnd.Get() : nullptr;
+ return pMsgCtrl ? pMsgCtrl->GetFocusedWindow() : nullptr;
}
void CPWL_Wnd::EnableWindow(bool bEnable) {