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

Side by Side Diff: xfa/fwl/core/cfwl_notedriver.cpp

Issue 2557103002: Cleanup FWL default values part II. (Closed)
Patch Set: Rebase to master Created 4 years 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 | « xfa/fwl/core/cfwl_notedriver.h ('k') | xfa/fwl/core/cfwl_scrollbar.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/core/cfwl_notedriver.h" 7 #include "xfa/fwl/core/cfwl_notedriver.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 CFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() { 77 CFWL_NoteLoop* CFWL_NoteDriver::PopNoteLoop() {
78 int32_t pos = m_noteLoopQueue.GetSize(); 78 int32_t pos = m_noteLoopQueue.GetSize();
79 if (pos <= 0) 79 if (pos <= 0)
80 return nullptr; 80 return nullptr;
81 81
82 CFWL_NoteLoop* p = m_noteLoopQueue.GetAt(pos - 1); 82 CFWL_NoteLoop* p = m_noteLoopQueue.GetAt(pos - 1);
83 m_noteLoopQueue.RemoveAt(pos - 1); 83 m_noteLoopQueue.RemoveAt(pos - 1);
84 return p; 84 return p;
85 } 85 }
86 86
87 bool CFWL_NoteDriver::SetFocus(CFWL_Widget* pFocus, bool bNotify) { 87 bool CFWL_NoteDriver::SetFocus(CFWL_Widget* pFocus) {
88 if (m_pFocus == pFocus) 88 if (m_pFocus == pFocus)
89 return true; 89 return true;
90 90
91 CFWL_Widget* pPrev = m_pFocus; 91 CFWL_Widget* pPrev = m_pFocus;
92 m_pFocus = pFocus; 92 m_pFocus = pFocus;
93 if (pPrev) { 93 if (pPrev) {
94 CFWL_MsgKillFocus ms(pPrev, pPrev); 94 if (IFWL_WidgetDelegate* pDelegate = pPrev->GetDelegate()) {
95 if (bNotify) 95 CFWL_MsgKillFocus ms(pPrev, pPrev);
96 ms.m_dwExtend = 1;
97
98 if (IFWL_WidgetDelegate* pDelegate = pPrev->GetDelegate())
99 pDelegate->OnProcessMessage(&ms); 96 pDelegate->OnProcessMessage(&ms);
97 }
100 } 98 }
101 if (pFocus) { 99 if (pFocus) {
102 CFWL_Widget* pWidget = 100 CFWL_Widget* pWidget =
103 pFocus->GetOwnerApp()->GetWidgetMgr()->GetSystemFormWidget(pFocus); 101 pFocus->GetOwnerApp()->GetWidgetMgr()->GetSystemFormWidget(pFocus);
104 CFWL_Form* pForm = static_cast<CFWL_Form*>(pWidget); 102 CFWL_Form* pForm = static_cast<CFWL_Form*>(pWidget);
105 if (pForm) 103 if (pForm)
106 pForm->SetSubFocus(pFocus); 104 pForm->SetSubFocus(pFocus);
107 105
108 CFWL_MsgSetFocus ms(nullptr, pFocus); 106 if (IFWL_WidgetDelegate* pDelegate = pFocus->GetDelegate()) {
109 if (bNotify) 107 CFWL_MsgSetFocus ms(nullptr, pFocus);
110 ms.m_dwExtend = 1;
111 if (IFWL_WidgetDelegate* pDelegate = pFocus->GetDelegate())
112 pDelegate->OnProcessMessage(&ms); 108 pDelegate->OnProcessMessage(&ms);
109 }
113 } 110 }
114 return true; 111 return true;
115 } 112 }
116 113
117 void CFWL_NoteDriver::Run() { 114 void CFWL_NoteDriver::Run() {
118 #if (_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_WIN32_DESKTOP_ || \ 115 #if (_FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_WIN32_DESKTOP_ || \
119 _FX_OS_ == _FX_WIN64_) 116 _FX_OS_ == _FX_WIN64_)
120 for (;;) { 117 for (;;) {
121 CFWL_NoteLoop* pTopLoop = GetTopLoop(); 118 CFWL_NoteLoop* pTopLoop = GetTopLoop();
122 if (!pTopLoop || !pTopLoop->ContinueModal()) 119 if (!pTopLoop || !pTopLoop->ContinueModal())
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 void CFWL_NoteDriver::ClearEventTargets(bool bRemoveAll) { 471 void CFWL_NoteDriver::ClearEventTargets(bool bRemoveAll) {
475 auto it = m_eventTargets.begin(); 472 auto it = m_eventTargets.begin();
476 while (it != m_eventTargets.end()) { 473 while (it != m_eventTargets.end()) {
477 auto old = it++; 474 auto old = it++;
478 if (old->second && (bRemoveAll || old->second->IsInvalid())) { 475 if (old->second && (bRemoveAll || old->second->IsInvalid())) {
479 delete old->second; 476 delete old->second;
480 m_eventTargets.erase(old); 477 m_eventTargets.erase(old);
481 } 478 }
482 } 479 }
483 } 480 }
OLDNEW
« no previous file with comments | « xfa/fwl/core/cfwl_notedriver.h ('k') | xfa/fwl/core/cfwl_scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698