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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view_views.h

Issue 6685082: Refactor Textfield and AutocompleteEditViewViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename IsValidChar to ShouldInsertChar. Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/autocomplete_edit_view_views.h
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_views.h b/chrome/browser/autocomplete/autocomplete_edit_view_views.h
index 4f32ed923ae32d2bc94d861c687dbd91bb0fa03c..92fb4b1acf939c80f190b26fda63df98ef479668 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_views.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_views.h
@@ -66,72 +66,74 @@ class AutocompleteEditViewViews : public views::View,
void HandleFocusOut();
// Implements views::View
- virtual bool OnMousePressed(const views::MouseEvent& event);
- virtual void Layout();
+ virtual void Layout() OVERRIDE;
virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
// Implement the AutocompleteEditView interface.
- virtual AutocompleteEditModel* model();
- virtual const AutocompleteEditModel* model() const;
+ virtual AutocompleteEditModel* model() OVERRIDE;
+ virtual const AutocompleteEditModel* model() const OVERRIDE;
- virtual void SaveStateToTab(TabContents* tab);
+ virtual void SaveStateToTab(TabContents* tab) OVERRIDE;
- virtual void Update(const TabContents* tab_for_state_restoring);
+ virtual void Update(const TabContents* tab_for_state_restoring) OVERRIDE;
virtual void OpenURL(const GURL& url,
WindowOpenDisposition disposition,
PageTransition::Type transition,
const GURL& alternate_nav_url,
size_t selected_line,
- const string16& keyword);
+ const string16& keyword) OVERRIDE;
- virtual string16 GetText() const;
+ virtual string16 GetText() const OVERRIDE;
- virtual bool IsEditingOrEmpty() const;
- virtual int GetIcon() const;
- virtual void SetUserText(const string16& text);
+ virtual bool IsEditingOrEmpty() const OVERRIDE;
+ virtual int GetIcon() const OVERRIDE;
+ virtual void SetUserText(const string16& text) OVERRIDE;
virtual void SetUserText(const string16& text,
const string16& display_text,
- bool update_popup);
+ bool update_popup) OVERRIDE;
virtual void SetWindowTextAndCaretPos(const string16& text,
- size_t caret_pos);
- virtual void SetForcedQuery();
- virtual bool IsSelectAll();
- virtual bool DeleteAtEndPressed();
+ size_t caret_pos) OVERRIDE;
+ virtual void SetForcedQuery() OVERRIDE;
+ virtual bool IsSelectAll() OVERRIDE;
+ virtual bool DeleteAtEndPressed() OVERRIDE;
virtual void GetSelectionBounds(string16::size_type* start,
- string16::size_type* end);
- virtual void SelectAll(bool reversed);
- virtual void RevertAll();
- virtual void UpdatePopup();
- virtual void ClosePopup();
- virtual void SetFocus();
- virtual void OnTemporaryTextMaybeChanged(const string16& display_text,
- bool save_original_selection);
+ string16::size_type* end) OVERRIDE;
+ virtual void SelectAll(bool reversed) OVERRIDE;
+ virtual void RevertAll() OVERRIDE;
+ virtual void UpdatePopup() OVERRIDE;
+ virtual void ClosePopup() OVERRIDE;
+ virtual void SetFocus() OVERRIDE;
+ virtual void OnTemporaryTextMaybeChanged(
+ const string16& display_text,
+ bool save_original_selection) OVERRIDE;
virtual bool OnInlineAutocompleteTextMaybeChanged(
- const string16& display_text, size_t user_text_length);
- virtual void OnRevertTemporaryText();
- virtual void OnBeforePossibleChange();
- virtual bool OnAfterPossibleChange();
- virtual gfx::NativeView GetNativeView() const;
- virtual CommandUpdater* GetCommandUpdater();
+ const string16& display_text, size_t user_text_length) OVERRIDE;
+ virtual void OnRevertTemporaryText() OVERRIDE;
+ virtual void OnBeforePossibleChange() OVERRIDE;
+ virtual bool OnAfterPossibleChange() OVERRIDE;
+ virtual gfx::NativeView GetNativeView() const OVERRIDE;
+ virtual CommandUpdater* GetCommandUpdater() OVERRIDE;
virtual void SetInstantSuggestion(const string16& input,
- bool animate_to_complete);
- virtual string16 GetInstantSuggestion() const;
- virtual int TextWidth() const;
- virtual bool IsImeComposing() const;
- virtual views::View* AddToView(views::View* parent);
- virtual int OnPerformDrop(const views::DropTargetEvent& event);
+ bool animate_to_complete) OVERRIDE;
+ virtual string16 GetInstantSuggestion() const OVERRIDE;
+ virtual int TextWidth() const OVERRIDE;
+ virtual bool IsImeComposing() const OVERRIDE;
+ virtual views::View* AddToView(views::View* parent) OVERRIDE;
+ virtual int OnPerformDrop(const views::DropTargetEvent& event) OVERRIDE;
// NotificationObserver:
virtual void Observe(NotificationType type,
const NotificationSource& source,
- const NotificationDetails& details);
+ const NotificationDetails& details) OVERRIDE;
// views::TextfieldController:
virtual void ContentsChanged(views::Textfield* sender,
- const string16& new_contents);
+ const string16& new_contents) OVERRIDE;
virtual bool HandleKeyEvent(views::Textfield* sender,
- const views::KeyEvent& key_event);
+ const views::KeyEvent& key_event) OVERRIDE;
+ virtual void OnBeforeUserAction(views::Textfield* sender) OVERRIDE;
+ virtual void OnAfterUserAction(views::Textfield* sender) OVERRIDE;
private:
// Return the number of characers in the current buffer.
@@ -180,33 +182,11 @@ class AutocompleteEditViewViews : public views::View,
// Tracking state before and after a possible change.
string16 text_before_change_;
ui::Range sel_before_change_;
-
- // TODO(oshima): following flags are copied from gtk implementation.
- // It should be possible to refactor this class to simplify flags and
- // logic. I'll work on this refactoring once all features are completed.
-
- // Indicates whether the IME changed the text. It's possible for the IME to
- // handle a key event but not change the text contents (e.g., when pressing
- // shift+del with no selection).
- bool text_changed_;
-
- // Was delete pressed?
- bool delete_was_pressed_;
+ bool ime_composing_before_change_;
// Was the delete key pressed with an empty selection at the end of the edit?
bool delete_at_end_pressed_;
- // Indicates if we are handling a key press event.
- bool handling_key_press_;
-
- // Indicates if omnibox's content maybe changed by a key press event, so that
- // we need to call OnAfterPossibleChange() after handling the event.
- // This flag should be set for changes directly caused by a key press event,
- // including changes to content text, selection range and preedit string.
- // Changes caused by function calls like SetUserText() should not affect this
- // flag.
- bool content_maybe_changed_by_key_press_;
-
DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewViews);
};

Powered by Google App Engine
This is Rietveld 408576698