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

Side by Side Diff: Source/core/html/forms/InputTypeView.h

Issue 27746003: Have InputType factories take an HTMLInputElement reference in parameter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/InputType.cpp ('k') | Source/core/html/forms/InputTypeView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 }; 63 };
64 64
65 // An InputTypeView object represents the UI-specific part of an 65 // An InputTypeView object represents the UI-specific part of an
66 // HTMLInputElement. Do not expose instances of InputTypeView and classes 66 // HTMLInputElement. Do not expose instances of InputTypeView and classes
67 // derived from it to classes other than HTMLInputElement. 67 // derived from it to classes other than HTMLInputElement.
68 class InputTypeView : public RefCounted<InputTypeView> { 68 class InputTypeView : public RefCounted<InputTypeView> {
69 WTF_MAKE_NONCOPYABLE(InputTypeView); 69 WTF_MAKE_NONCOPYABLE(InputTypeView);
70 WTF_MAKE_FAST_ALLOCATED; 70 WTF_MAKE_FAST_ALLOCATED;
71 71
72 public: 72 public:
73 static PassRefPtr<InputTypeView> create(HTMLInputElement*); 73 static PassRefPtr<InputTypeView> create(HTMLInputElement&);
74 virtual ~InputTypeView(); 74 virtual ~InputTypeView();
75 75
76 virtual bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize ) const; 76 virtual bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize ) const;
77 virtual void handleClickEvent(MouseEvent*); 77 virtual void handleClickEvent(MouseEvent*);
78 virtual void handleMouseDownEvent(MouseEvent*); 78 virtual void handleMouseDownEvent(MouseEvent*);
79 virtual PassOwnPtr<ClickHandlingState> willDispatchClick(); 79 virtual PassOwnPtr<ClickHandlingState> willDispatchClick();
80 virtual void didDispatchClick(Event*, const ClickHandlingState&); 80 virtual void didDispatchClick(Event*, const ClickHandlingState&);
81 virtual void handleKeydownEvent(KeyboardEvent*); 81 virtual void handleKeydownEvent(KeyboardEvent*);
82 virtual void handleKeypressEvent(KeyboardEvent*); 82 virtual void handleKeypressEvent(KeyboardEvent*);
83 virtual void handleKeyupEvent(KeyboardEvent*); 83 virtual void handleKeyupEvent(KeyboardEvent*);
(...skipping 19 matching lines...) Expand all
103 virtual void attributeChanged(); 103 virtual void attributeChanged();
104 virtual void multipleAttributeChanged(); 104 virtual void multipleAttributeChanged();
105 virtual void disabledAttributeChanged(); 105 virtual void disabledAttributeChanged();
106 virtual void readonlyAttributeChanged(); 106 virtual void readonlyAttributeChanged();
107 virtual void requiredAttributeChanged(); 107 virtual void requiredAttributeChanged();
108 virtual void valueAttributeChanged(); 108 virtual void valueAttributeChanged();
109 virtual void listAttributeTargetChanged(); 109 virtual void listAttributeTargetChanged();
110 virtual void updateClearButtonVisibility(); 110 virtual void updateClearButtonVisibility();
111 111
112 protected: 112 protected:
113 InputTypeView(HTMLInputElement* element) : m_element(element) { } 113 InputTypeView(HTMLInputElement& element) : m_element(element) { }
114 HTMLInputElement* element() const { return m_element; } 114 HTMLInputElement& element() const { return m_element; }
115 115
116 private: 116 private:
117 // Raw pointer because the HTMLInputElement object owns this InputTypeView 117 // Not a RefPtr because the HTMLInputElement object owns this InputTypeView
118 // object. 118 // object.
119 HTMLInputElement* m_element; 119 HTMLInputElement& m_element;
120 }; 120 };
121 121
122 } // namespace WebCore 122 } // namespace WebCore
123 #endif 123 #endif
OLDNEW
« no previous file with comments | « Source/core/html/forms/InputType.cpp ('k') | Source/core/html/forms/InputTypeView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698