OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 virtual void OnBeforePossibleChange(); | 132 virtual void OnBeforePossibleChange(); |
133 virtual bool OnAfterPossibleChange(); | 133 virtual bool OnAfterPossibleChange(); |
134 virtual gfx::NativeView GetNativeView() const; | 134 virtual gfx::NativeView GetNativeView() const; |
135 virtual CommandUpdater* GetCommandUpdater(); | 135 virtual CommandUpdater* GetCommandUpdater(); |
136 virtual void SetInstantSuggestion(const string16& suggestion); | 136 virtual void SetInstantSuggestion(const string16& suggestion); |
137 virtual string16 GetInstantSuggestion() const; | 137 virtual string16 GetInstantSuggestion() const; |
138 virtual int TextWidth() const; | 138 virtual int TextWidth() const; |
139 virtual bool IsImeComposing() const; | 139 virtual bool IsImeComposing() const; |
140 | 140 |
141 virtual views::View* AddToView(views::View* parent); | 141 virtual views::View* AddToView(views::View* parent); |
| 142 virtual int OnPerformDrop(const views::DropTargetEvent& event); |
142 | 143 |
143 int GetPopupMaxYCoordinate(); | 144 int GetPopupMaxYCoordinate(); |
144 | 145 |
145 // Exposes custom IAccessible implementation to the overall MSAA hierarchy. | 146 // Exposes custom IAccessible implementation to the overall MSAA hierarchy. |
146 IAccessible* GetIAccessible(); | 147 IAccessible* GetIAccessible(); |
147 | 148 |
148 void SetDropHighlightPosition(int position); | 149 void SetDropHighlightPosition(int position); |
149 int drop_highlight_position() const { return drop_highlight_position_; } | 150 int drop_highlight_position() const { return drop_highlight_position_; } |
150 | 151 |
151 // Returns true if a drag a drop session was initiated by this edit. | 152 // Returns true if a drag a drop session was initiated by this edit. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 ITextDocument* text_object_model); | 238 ITextDocument* text_object_model); |
238 ~ScopedFreeze(); | 239 ~ScopedFreeze(); |
239 | 240 |
240 private: | 241 private: |
241 AutocompleteEditViewWin* const edit_; | 242 AutocompleteEditViewWin* const edit_; |
242 ITextDocument* const text_object_model_; | 243 ITextDocument* const text_object_model_; |
243 | 244 |
244 DISALLOW_COPY_AND_ASSIGN(ScopedFreeze); | 245 DISALLOW_COPY_AND_ASSIGN(ScopedFreeze); |
245 }; | 246 }; |
246 | 247 |
| 248 class EditDropTarget; |
| 249 friend class EditDropTarget; |
| 250 |
247 // This object suspends placing any operations on the edit's undo stack until | 251 // This object suspends placing any operations on the edit's undo stack until |
248 // the object is destroyed. If we don't do this, some of the operations we | 252 // the object is destroyed. If we don't do this, some of the operations we |
249 // perform behind the user's back will be undoable by the user, which feels | 253 // perform behind the user's back will be undoable by the user, which feels |
250 // bizarre and confusing. | 254 // bizarre and confusing. |
251 class ScopedSuspendUndo { | 255 class ScopedSuspendUndo { |
252 public: | 256 public: |
253 explicit ScopedSuspendUndo(ITextDocument* text_object_model); | 257 explicit ScopedSuspendUndo(ITextDocument* text_object_model); |
254 ~ScopedSuspendUndo(); | 258 ~ScopedSuspendUndo(); |
255 | 259 |
256 private: | 260 private: |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 int GetHorizontalMargin() const; | 409 int GetHorizontalMargin() const; |
406 | 410 |
407 // Returns the width in pixels needed to display |text|. | 411 // Returns the width in pixels needed to display |text|. |
408 int WidthNeededToDisplay(const string16& text) const; | 412 int WidthNeededToDisplay(const string16& text) const; |
409 | 413 |
410 // Real implementation of OnAfterPossibleChange() method. | 414 // Real implementation of OnAfterPossibleChange() method. |
411 // If |force_text_changed| is true, then the text_changed code will always be | 415 // If |force_text_changed| is true, then the text_changed code will always be |
412 // triggerred no matter if the text is actually changed or not. | 416 // triggerred no matter if the text is actually changed or not. |
413 bool OnAfterPossibleChangeInternal(bool force_text_changed); | 417 bool OnAfterPossibleChangeInternal(bool force_text_changed); |
414 | 418 |
| 419 // Common implementation for performing a drop on the edit view. |
| 420 int OnPerformDropImpl(const views::DropTargetEvent& event, bool in_drag); |
| 421 |
415 scoped_ptr<AutocompleteEditModel> model_; | 422 scoped_ptr<AutocompleteEditModel> model_; |
416 | 423 |
417 scoped_ptr<AutocompletePopupView> popup_view_; | 424 scoped_ptr<AutocompletePopupView> popup_view_; |
418 | 425 |
419 AutocompleteEditController* controller_; | 426 AutocompleteEditController* controller_; |
420 | 427 |
421 // The parent view for the edit, used to align the popup and for | 428 // The parent view for the edit, used to align the popup and for |
422 // accessibility. | 429 // accessibility. |
423 views::View* parent_view_; | 430 views::View* parent_view_; |
424 | 431 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 // striken-out when displaying an insecure scheme. | 536 // striken-out when displaying an insecure scheme. |
530 url_parse::Component insecure_scheme_component_; | 537 url_parse::Component insecure_scheme_component_; |
531 | 538 |
532 // Instance of accessibility information and handling. | 539 // Instance of accessibility information and handling. |
533 mutable ScopedComPtr<IAccessible> autocomplete_accessibility_; | 540 mutable ScopedComPtr<IAccessible> autocomplete_accessibility_; |
534 | 541 |
535 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewWin); | 542 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewWin); |
536 }; | 543 }; |
537 | 544 |
538 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_ | 545 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_WIN_H_ |
OLD | NEW |