| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_MAC_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
| 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/autocomplete/autocomplete.h" | 13 #include "chrome/browser/autocomplete/autocomplete.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" | 14 #include "chrome/browser/autocomplete/autocomplete_edit_view.h" |
| 15 #include "chrome/browser/toolbar_model.h" | 15 #include "chrome/browser/toolbar_model.h" |
| 16 #include "chrome/common/page_transition_types.h" | 16 #include "chrome/common/page_transition_types.h" |
| 17 #include "webkit/glue/window_open_disposition.h" | 17 #include "webkit/glue/window_open_disposition.h" |
| 18 | 18 |
| 19 class AutocompleteEditController; | 19 class AutocompleteEditController; |
| 20 @class AutocompleteEditHelper; | |
| 21 class AutocompleteEditModel; | 20 class AutocompleteEditModel; |
| 21 @class AutocompleteFieldDelegate; |
| 22 class AutocompletePopupViewMac; | 22 class AutocompletePopupViewMac; |
| 23 @class AutocompleteTextField; | 23 @class AutocompleteTextField; |
| 24 class BubblePositioner; | 24 class BubblePositioner; |
| 25 class Clipboard; | 25 class Clipboard; |
| 26 class CommandUpdater; | 26 class CommandUpdater; |
| 27 class Profile; | 27 class Profile; |
| 28 class TabContents; | 28 class TabContents; |
| 29 class ToolbarModel; | 29 class ToolbarModel; |
| 30 | 30 |
| 31 // Implements AutocompleteEditView on an AutocompleteTextField. | 31 // Implements AutocompleteEditView on an AutocompleteTextField. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 virtual void SetFocus(); | 81 virtual void SetFocus(); |
| 82 virtual void OnTemporaryTextMaybeChanged(const std::wstring& display_text, | 82 virtual void OnTemporaryTextMaybeChanged(const std::wstring& display_text, |
| 83 bool save_original_selection); | 83 bool save_original_selection); |
| 84 virtual bool OnInlineAutocompleteTextMaybeChanged( | 84 virtual bool OnInlineAutocompleteTextMaybeChanged( |
| 85 const std::wstring& display_text, size_t user_text_length); | 85 const std::wstring& display_text, size_t user_text_length); |
| 86 virtual void OnRevertTemporaryText(); | 86 virtual void OnRevertTemporaryText(); |
| 87 virtual void OnBeforePossibleChange(); | 87 virtual void OnBeforePossibleChange(); |
| 88 virtual bool OnAfterPossibleChange(); | 88 virtual bool OnAfterPossibleChange(); |
| 89 virtual gfx::NativeView GetNativeView() const; | 89 virtual gfx::NativeView GetNativeView() const; |
| 90 | 90 |
| 91 // Helper functions for use from AutocompleteEditHelper Objective-C | 91 // Helper functions for use from AutocompleteFieldDelegate Objective-C |
| 92 // class. | 92 // class. |
| 93 | 93 |
| 94 // Returns true if |popup_view_| is open. | 94 // Returns true if |popup_view_| is open. |
| 95 bool IsPopupOpen() const; | 95 bool IsPopupOpen() const; |
| 96 | 96 |
| 97 // Trivial wrappers forwarding to |model_| methods. | 97 // Trivial wrappers forwarding to |model_| methods. |
| 98 void OnControlKeyChanged(bool pressed); | 98 void OnControlKeyChanged(bool pressed); |
| 99 void OnEscapeKeyPressed(); | 99 void OnEscapeKeyPressed(); |
| 100 void OnUpOrDownKeyPressed(bool up, bool by_page); | 100 void OnUpOrDownKeyPressed(bool up, bool by_page); |
| 101 | 101 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 AutocompleteEditController* controller_; | 169 AutocompleteEditController* controller_; |
| 170 ToolbarModel* toolbar_model_; | 170 ToolbarModel* toolbar_model_; |
| 171 | 171 |
| 172 // The object that handles additional command functionality exposed on the | 172 // The object that handles additional command functionality exposed on the |
| 173 // edit, such as invoking the keyword editor. | 173 // edit, such as invoking the keyword editor. |
| 174 CommandUpdater* command_updater_; | 174 CommandUpdater* command_updater_; |
| 175 | 175 |
| 176 AutocompleteTextField* field_; // owned by tab controller | 176 AutocompleteTextField* field_; // owned by tab controller |
| 177 | 177 |
| 178 // Objective-C object to bridge field_ delegate calls to C++. | 178 // Objective-C object to bridge field_ delegate calls to C++. |
| 179 scoped_nsobject<AutocompleteEditHelper> edit_helper_; | 179 scoped_nsobject<AutocompleteFieldDelegate> edit_helper_; |
| 180 | 180 |
| 181 // Selection at the point where the user started using the | 181 // Selection at the point where the user started using the |
| 182 // arrows to move around in the popup. | 182 // arrows to move around in the popup. |
| 183 NSRange saved_temporary_selection_; | 183 NSRange saved_temporary_selection_; |
| 184 | 184 |
| 185 // Tracking state before and after a possible change for reporting | 185 // Tracking state before and after a possible change for reporting |
| 186 // to model_. | 186 // to model_. |
| 187 NSRange selection_before_change_; | 187 NSRange selection_before_change_; |
| 188 std::wstring text_before_change_; | 188 std::wstring text_before_change_; |
| 189 | 189 |
| 190 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); | 190 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); |
| 191 }; | 191 }; |
| 192 | 192 |
| 193 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 193 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
| OLD | NEW |