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

Unified Diff: chrome/browser/autocomplete/autocomplete_edit_view.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/autocomplete_edit_view.h
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view.h b/chrome/browser/autocomplete/autocomplete_edit_view.h
index 439b2edce7b6cb36baa3a94efebf4392095694e7..12c42a239ac2dc8a323da48f17c180e4147c95ee 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view.h
+++ b/chrome/browser/autocomplete/autocomplete_edit_view.h
@@ -24,6 +24,12 @@ class CommandUpdater;
class GURL;
class TabContents;
+#if defined(TOOLKIT_VIEWS)
+namespace views {
+class View;
+} // namespace views
+#endif
+
class AutocompleteEditView {
public:
// Used by the automation system for getting at the model from the view.
@@ -152,7 +158,23 @@ class AutocompleteEditView {
// Returns the command updater for this view.
virtual CommandUpdater* GetCommandUpdater() = 0;
- protected:
+#if defined(TOOLKIT_VIEWS)
+ // Adds the autocomplete edit view to view hierarchy and
+ // returns the views::View of the edit view.
+ virtual views::View* AddToView(views::View* parent) = 0;
+
+ // Commits the suggested text.
+ virtual bool CommitInstantSuggestion(const std::wstring& typed_text,
+ const std::wstring& suggested_text) = 0;
James Su 2011/01/06 23:01:35 The implementation of this method on all platforms
oshima 2011/01/06 23:32:45 I really like the idea to have the same implementa
James Su 2011/01/06 23:49:08 Then I'd prefer not to refactor this part for now.
oshima 2011/01/07 01:49:39 I can't eliminate Gtk's type without common method
+
+ // Shows the instant suggestion text.
+ virtual void SetInstantSuggestion(const string16& input) = 0;
James Su 2011/01/06 23:49:08 It's probably better to generalize this method for
oshima 2011/01/07 01:49:39 Good idea. I'll do it, but in separate CL. I'd lik
+
+ // Returns the width in pixels needed to display the current text. The
+ // returned value includes margins.
+ virtual int TextWidth() const = 0;
James Su 2011/01/06 23:01:35 How about move it out of the #if block? It's neces
oshima 2011/01/06 23:32:45 I didn't do so because mac doesn't have it. I can
James Su 2011/01/06 23:49:08 I'd prefer to move it out of the #if block, as Gtk
oshima 2011/01/07 01:49:39 Ok, but let me do it in separate CL, same reason a
+#endif
+
virtual ~AutocompleteEditView() {}
};

Powered by Google App Engine
This is Rietveld 408576698