summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 20:54:28 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 20:54:28 +0000
commit74b9879d2ed5a67e2935703e171059d40924e462 (patch)
tree9480fdae2a791f5546bb53db2294e9f0018a50a0 /chrome/browser/autocomplete/autocomplete_edit_view_mac.h
parentef6177f7be8c308d7a497972e6fb21ec1d265187 (diff)
downloadchromium_src-74b9879d2ed5a67e2935703e171059d40924e462.zip
chromium_src-74b9879d2ed5a67e2935703e171059d40924e462.tar.gz
chromium_src-74b9879d2ed5a67e2935703e171059d40924e462.tar.bz2
Implement OnBeforePossibleChange() and OnAfterPossibleChange() to fix delete in Mac Omnibox.
BUG=10030 Review URL: http://codereview.chromium.org/67136 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13700 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_edit_view_mac.h')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
index 8a6147e..d6b0928 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.h
@@ -78,8 +78,8 @@ class AutocompleteEditViewMac : public AutocompleteEditView {
virtual bool OnInlineAutocompleteTextMaybeChanged(
const std::wstring& display_text, size_t user_text_length);
virtual void OnRevertTemporaryText();
- virtual void OnBeforePossibleChange() { NOTIMPLEMENTED(); }
- virtual bool OnAfterPossibleChange() { NOTIMPLEMENTED(); return false; }
+ virtual void OnBeforePossibleChange();
+ virtual bool OnAfterPossibleChange();
// Helper functions which forward to our private: model_.
void OnUpOrDownKeyPressed(int dir);
@@ -87,11 +87,6 @@ class AutocompleteEditViewMac : public AutocompleteEditView {
void OnSetFocus(bool f);
void OnKillFocus();
void AcceptInput(WindowOpenDisposition disposition, bool for_drop);
- void OnAfterPossibleChange(const std::wstring& new_text,
- bool selection_differs,
- bool text_differs,
- bool just_deleted_text,
- bool at_end_of_edit);
// TODO(shess): Get rid of this. Right now it's needed because of
// the ordering of initialization in tab_contents_controller.mm.
@@ -101,6 +96,10 @@ class AutocompleteEditViewMac : public AutocompleteEditView {
void FocusLocation();
private:
+ // Returns the field's currently selected range. Only valid if the
+ // field has focus.
+ NSRange GetSelectedRange() const;
+
scoped_ptr<AutocompleteEditModel> model_;
scoped_ptr<AutocompletePopupViewMac> popup_view_;
@@ -118,6 +117,11 @@ class AutocompleteEditViewMac : public AutocompleteEditView {
std::wstring saved_temporary_text_;
+ // Tracking state before and after a possible change for reporting
+ // to model_.
+ NSRange selection_before_change_;
+ std::wstring text_before_change_;
+
DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac);
};