Skip to content

Commit

Permalink
Bug 1260651 part.54 Rename nsHTMLEditorEventListeners to mozilla::HTM…
Browse files Browse the repository at this point in the history
…LEditorEventListener (and their file names) r=mccr8

MozReview-Commit-ID: DFW3E2WfXzJ
  • Loading branch information
masayuki-nakano committed Jul 7, 2016
1 parent 19c72ac commit ca1412f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsHTMLEditorEventListener.h"
#include "HTMLEditorEventListener.h"

#include "HTMLEditUtils.h"
#include "mozilla/dom/Event.h"
Expand All @@ -27,17 +27,13 @@
#include "nsQueryObject.h"
#include "nsRange.h"

using namespace mozilla;
using namespace mozilla::dom;
namespace mozilla {

/*
* nsHTMLEditorEventListener implementation
*
*/
using namespace dom;

#ifdef DEBUG
nsresult
nsHTMLEditorEventListener::Connect(nsEditor* aEditor)
HTMLEditorEventListener::Connect(nsEditor* aEditor)
{
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryObject(aEditor);
nsCOMPtr<nsIHTMLInlineTableEditor> htmlInlineTableEditor =
Expand All @@ -49,14 +45,14 @@ nsHTMLEditorEventListener::Connect(nsEditor* aEditor)
#endif

nsHTMLEditor*
nsHTMLEditorEventListener::GetHTMLEditor()
HTMLEditorEventListener::GetHTMLEditor()
{
// mEditor must be nsHTMLEditor or its subclass.
return static_cast<nsHTMLEditor*>(mEditor);
}

nsresult
nsHTMLEditorEventListener::MouseUp(nsIDOMMouseEvent* aMouseEvent)
HTMLEditorEventListener::MouseUp(nsIDOMMouseEvent* aMouseEvent)
{
nsHTMLEditor* htmlEditor = GetHTMLEditor();

Expand All @@ -75,7 +71,7 @@ nsHTMLEditorEventListener::MouseUp(nsIDOMMouseEvent* aMouseEvent)
}

nsresult
nsHTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
HTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
{
nsHTMLEditor* htmlEditor = GetHTMLEditor();
// Contenteditable should disregard mousedowns outside it.
Expand Down Expand Up @@ -205,7 +201,7 @@ nsHTMLEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
}

nsresult
nsHTMLEditorEventListener::MouseClick(nsIDOMMouseEvent* aMouseEvent)
HTMLEditorEventListener::MouseClick(nsIDOMMouseEvent* aMouseEvent)
{
nsCOMPtr<nsIDOMEventTarget> target;
nsresult rv = aMouseEvent->AsEvent()->GetTarget(getter_AddRefs(target));
Expand All @@ -217,3 +213,5 @@ nsHTMLEditorEventListener::MouseClick(nsIDOMMouseEvent* aMouseEvent)

return nsEditorEventListener::MouseClick(aMouseEvent);
}

} // namespace mozilla
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsHTMLEditorEventListener_h__
#define nsHTMLEditorEventListener_h__
#ifndef HTMLEditorEventListener_h
#define HTMLEditorEventListener_h

#include "nsEditorEventListener.h"
#include "nscore.h"

class nsEditor;
class nsHTMLEditor;

class nsHTMLEditorEventListener : public nsEditorEventListener
namespace mozilla {

class HTMLEditorEventListener final : public nsEditorEventListener
{
public:
nsHTMLEditorEventListener() :
nsEditorEventListener()
HTMLEditorEventListener()
{
}

virtual ~nsHTMLEditorEventListener()
virtual ~HTMLEditorEventListener()
{
}

Expand All @@ -37,5 +38,6 @@ class nsHTMLEditorEventListener : public nsEditorEventListener
inline nsHTMLEditor* GetHTMLEditor();
};

#endif // nsHTMLEditorEventListener_h__
} // namespace mozilla

#endif // #ifndef HTMLEditorEventListener_h
2 changes: 1 addition & 1 deletion editor/libeditor/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ UNIFIED_SOURCES += [
'EditorController.cpp',
'EditorUtils.cpp',
'EditTransactionBase.cpp',
'HTMLEditorEventListener.cpp',
'HTMLEditRules.cpp',
'HTMLEditUtils.cpp',
'HTMLURIRefObject.cpp',
Expand All @@ -51,7 +52,6 @@ UNIFIED_SOURCES += [
'nsHTMLAnonymousUtils.cpp',
'nsHTMLDataTransfer.cpp',
'nsHTMLEditor.cpp',
'nsHTMLEditorEventListener.cpp',
'nsHTMLEditorStyle.cpp',
'nsHTMLInlineTableEditor.cpp',
'nsHTMLObjectResizer.cpp',
Expand Down
2 changes: 1 addition & 1 deletion editor/libeditor/nsEditorEventListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ nsEditorEventListener::NotifyIMEOfMouseButtonEvent(
nsresult
nsEditorEventListener::MouseDown(nsIDOMMouseEvent* aMouseEvent)
{
// FYI: This may be called by nsHTMLEditorEventListener::MouseDown() even
// FYI: This may be called by HTMLEditorEventListener::MouseDown() even
// when the event is not acceptable for committing composition.
mEditor->ForceCompositionEnd();
return NS_OK;
Expand Down
10 changes: 4 additions & 6 deletions editor/libeditor/nsHTMLEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@

#include "nsUnicharUtils.h"

#include "HTMLEditorEventListener.h"
#include "HTMLEditRules.h"
#include "HTMLEditUtils.h"
#include "HTMLURIRefObject.h"
#include "SetDocumentTitleTransaction.h"
#include "StyleSheetTransactions.h"
#include "TextEditUtils.h"

#include "nsHTMLEditorEventListener.h"
#include "TypeInState.h"


#include "nsIDOMText.h"
#include "nsIDOMMozNamedAttrMap.h"
#include "nsIDOMNodeList.h"
Expand Down Expand Up @@ -442,7 +440,7 @@ nsHTMLEditor::CreateEventListeners()
{
// Don't create the handler twice
if (!mEventListener) {
mEventListener = new nsHTMLEditorEventListener();
mEventListener = new HTMLEditorEventListener();
}
}

Expand All @@ -455,8 +453,8 @@ nsHTMLEditor::InstallEventListeners()
// NOTE: nsHTMLEditor doesn't need to initialize mEventTarget here because
// the target must be document node and it must be referenced as weak pointer.

nsHTMLEditorEventListener* listener =
reinterpret_cast<nsHTMLEditorEventListener*>(mEventListener.get());
HTMLEditorEventListener* listener =
reinterpret_cast<HTMLEditorEventListener*>(mEventListener.get());
return listener->Connect(this);
}

Expand Down
3 changes: 2 additions & 1 deletion editor/libeditor/nsHTMLEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class nsIDOMRange;
class nsRange;

namespace mozilla {
class HTMLEditorEventListener;
class HTMLEditRules;
class TextEditRules;
class TypeInState;
Expand Down Expand Up @@ -974,10 +975,10 @@ class nsHTMLEditor final : public nsPlaintextEditor,

public:
// friends
friend class mozilla::HTMLEditorEventListener;
friend class mozilla::HTMLEditRules;
friend class mozilla::TextEditRules;
friend class mozilla::WSRunObject;
friend class nsHTMLEditorEventListener;

private:
// Helpers
Expand Down

0 comments on commit ca1412f

Please sign in to comment.