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

Side by Side Diff: chrome/browser/autocomplete/autocomplete_edit_view_win.h

Issue 6036004: Refactor AutocompleteEditViewGtk so that AutocompleteEditView impl can be swapped. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 11 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlapp.h> 10 #include <atlapp.h>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 views::View* parent_view, 67 views::View* parent_view,
68 HWND hwnd, 68 HWND hwnd,
69 Profile* profile, 69 Profile* profile,
70 CommandUpdater* command_updater, 70 CommandUpdater* command_updater,
71 bool popup_window_mode, 71 bool popup_window_mode,
72 const views::View* location_bar); 72 const views::View* location_bar);
73 ~AutocompleteEditViewWin(); 73 ~AutocompleteEditViewWin();
74 74
75 views::View* parent_view() const { return parent_view_; } 75 views::View* parent_view() const { return parent_view_; }
76 76
77 // Returns the width in pixels needed to display the current text. The
78 // returned value includes margins.
79 int TextWidth();
80
81 // Returns the width in pixels needed to display the text from one character 77 // Returns the width in pixels needed to display the text from one character
82 // before the caret to the end of the string. See comments in 78 // before the caret to the end of the string. See comments in
83 // LocationBarView::Layout as to why this uses -1. 79 // LocationBarView::Layout as to why this uses -1.
84 int WidthOfTextAfterCursor(); 80 int WidthOfTextAfterCursor();
85 81
86 // Returns the font. 82 // Returns the font.
87 gfx::Font GetFont(); 83 gfx::Font GetFont();
88 84
89 // Implement the AutocompleteEditView interface. 85 // Implement the AutocompleteEditView interface.
90 virtual AutocompleteEditModel* model() { return model_.get(); } 86 virtual AutocompleteEditModel* model() { return model_.get(); }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 126
131 virtual void OnTemporaryTextMaybeChanged(const std::wstring& display_text, 127 virtual void OnTemporaryTextMaybeChanged(const std::wstring& display_text,
132 bool save_original_selection); 128 bool save_original_selection);
133 virtual bool OnInlineAutocompleteTextMaybeChanged( 129 virtual bool OnInlineAutocompleteTextMaybeChanged(
134 const std::wstring& display_text, size_t user_text_length); 130 const std::wstring& display_text, size_t user_text_length);
135 virtual void OnRevertTemporaryText(); 131 virtual void OnRevertTemporaryText();
136 virtual void OnBeforePossibleChange(); 132 virtual void OnBeforePossibleChange();
137 virtual bool OnAfterPossibleChange(); 133 virtual bool OnAfterPossibleChange();
138 virtual gfx::NativeView GetNativeView() const; 134 virtual gfx::NativeView GetNativeView() const;
139 virtual CommandUpdater* GetCommandUpdater(); 135 virtual CommandUpdater* GetCommandUpdater();
136 virtual views::View* AddToView(views::View* parent);
137 virtual bool CommitInstantSuggestion(const std::wstring& typed_text,
138 const std::wstring& suggested_text);
139 virtual void SetInstantSuggestion(const string16& suggestion);
140 virtual int TextWidth() const;
141
140 int GetPopupMaxYCoordinate(); 142 int GetPopupMaxYCoordinate();
141 143
142 // Exposes custom IAccessible implementation to the overall MSAA hierarchy. 144 // Exposes custom IAccessible implementation to the overall MSAA hierarchy.
143 IAccessible* GetIAccessible(); 145 IAccessible* GetIAccessible();
144 146
145 void SetDropHighlightPosition(int position); 147 void SetDropHighlightPosition(int position);
146 int drop_highlight_position() const { return drop_highlight_position_; } 148 int drop_highlight_position() const { return drop_highlight_position_; }
147 149
148 // Returns true if a drag a drop session was initiated by this edit. 150 // Returns true if a drag a drop session was initiated by this edit.
149 bool in_drag() const { return in_drag_; } 151 bool in_drag() const { return in_drag_; }
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // text. 396 // text.
395 void RepaintDropHighlight(int position); 397 void RepaintDropHighlight(int position);
396 398
397 // Generates the context menu for the edit field. 399 // Generates the context menu for the edit field.
398 void BuildContextMenu(); 400 void BuildContextMenu();
399 401
400 void SelectAllIfNecessary(MouseButton button, const CPoint& point); 402 void SelectAllIfNecessary(MouseButton button, const CPoint& point);
401 void TrackMousePosition(MouseButton button, const CPoint& point); 403 void TrackMousePosition(MouseButton button, const CPoint& point);
402 404
403 // Returns the sum of the left and right margins. 405 // Returns the sum of the left and right margins.
404 int GetHorizontalMargin(); 406 int GetHorizontalMargin() const;
405 407
406 // Returns the width in pixels needed to display |text|. 408 // Returns the width in pixels needed to display |text|.
407 int WidthNeededToDisplay(const std::wstring& text); 409 int WidthNeededToDisplay(const std::wstring& text) const;
408 410
409 scoped_ptr<AutocompleteEditModel> model_; 411 scoped_ptr<AutocompleteEditModel> model_;
410 412
411 scoped_ptr<AutocompletePopupView> popup_view_; 413 scoped_ptr<AutocompletePopupView> popup_view_;
412 414
413 AutocompleteEditController* controller_; 415 AutocompleteEditController* controller_;
414 416
415 // The parent view for the edit, used to align the popup and for 417 // The parent view for the edit, used to align the popup and for
416 // accessibility. 418 // accessibility.
417 views::View* parent_view_; 419 views::View* parent_view_;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // striken-out when displaying an insecure scheme. 525 // striken-out when displaying an insecure scheme.
524 url_parse::Component insecure_scheme_component_; 526 url_parse::Component insecure_scheme_component_;
525 527
526 // Instance of accessibility information and handling. 528 // Instance of accessibility information and handling.
527 mutable ScopedComPtr<IAccessible> autocomplete_accessibility_; 529 mutable ScopedComPtr<IAccessible> autocomplete_accessibility_;
528 530
529 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewWin); 531 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewWin);
530 }; 532 };
531 533
532 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_ 534 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698