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 "grit/generated_resources.h" | |
17 #include "webkit/glue/window_open_disposition.h" | 18 #include "webkit/glue/window_open_disposition.h" |
18 | 19 |
19 class AutocompleteEditController; | 20 class AutocompleteEditController; |
20 class AutocompleteEditModel; | 21 class AutocompleteEditModel; |
21 @class AutocompleteFieldDelegate; | 22 @class AutocompleteFieldDelegate; |
22 class AutocompletePopupViewMac; | 23 class AutocompletePopupViewMac; |
23 @class AutocompleteTextField; | 24 @class AutocompleteTextField; |
24 class BubblePositioner; | 25 class BubblePositioner; |
25 class Clipboard; | 26 class Clipboard; |
26 class CommandUpdater; | 27 class CommandUpdater; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 // Called when editing ends in the field. | 107 // Called when editing ends in the field. |
107 void OnDidEndEditing(); | 108 void OnDidEndEditing(); |
108 | 109 |
109 // Called when the window |field_| is in loses key to clean up | 110 // Called when the window |field_| is in loses key to clean up |
110 // visual state (such as closing the popup). | 111 // visual state (such as closing the popup). |
111 void OnDidResignKey(); | 112 void OnDidResignKey(); |
112 | 113 |
113 // Called when the user attempts to paste into |field_|. | 114 // Called when the user attempts to paste into |field_|. |
114 void OnPaste(); | 115 void OnPaste(); |
115 | 116 |
117 // Returns true if the current clipboard text supports paste and go (or paste | |
118 // and search). | |
119 bool CanPasteAndGo(); | |
120 | |
121 // Returns the appropriate "Paste and Go" or "Paste and Search" context menu | |
122 // string, depending on what is currently in the clipboard. Must not be | |
123 // called unless CanPasteAndGo() returns true. | |
124 int GetPasteActionStringId(); | |
125 | |
126 // Called when the user initiates a "pastes and go" or "paste and search" into | |
rohitrao (ping after 24h)
2009/09/18 19:17:12
Typo fixed but didn't bother to reupload.
| |
127 // |field_|. | |
128 void OnPasteAndGo(); | |
129 | |
116 // Checks if a keyword search is possible and forwards to |model_| | 130 // Checks if a keyword search is possible and forwards to |model_| |
117 // if so. Returns true if the tab should be eaten. | 131 // if so. Returns true if the tab should be eaten. |
118 bool OnTabPressed(); | 132 bool OnTabPressed(); |
119 | 133 |
120 // Called when the user hits backspace in |field_|. Checks whether | 134 // Called when the user hits backspace in |field_|. Checks whether |
121 // keyword search is being terminated. Returns true if the | 135 // keyword search is being terminated. Returns true if the |
122 // backspace should be intercepted (not forwarded on to the standard | 136 // backspace should be intercepted (not forwarded on to the standard |
123 // machinery). | 137 // machinery). |
124 bool OnBackspacePressed(); | 138 bool OnBackspacePressed(); |
125 | 139 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 | 198 |
185 // Tracking state before and after a possible change for reporting | 199 // Tracking state before and after a possible change for reporting |
186 // to model_. | 200 // to model_. |
187 NSRange selection_before_change_; | 201 NSRange selection_before_change_; |
188 std::wstring text_before_change_; | 202 std::wstring text_before_change_; |
189 | 203 |
190 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); | 204 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditViewMac); |
191 }; | 205 }; |
192 | 206 |
193 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ | 207 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_VIEW_MAC_H_ |
OLD | NEW |