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_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // revert about any current edits. Returns whether the key was handled. | 284 // revert about any current edits. Returns whether the key was handled. |
285 bool OnEscapeKeyPressed(); | 285 bool OnEscapeKeyPressed(); |
286 | 286 |
287 // Called when the user presses or releases the control key. Changes state as | 287 // Called when the user presses or releases the control key. Changes state as |
288 // necessary. | 288 // necessary. |
289 void OnControlKeyChanged(bool pressed); | 289 void OnControlKeyChanged(bool pressed); |
290 | 290 |
291 // Called when the user pastes in text. | 291 // Called when the user pastes in text. |
292 void on_paste() { paste_state_ = PASTING; } | 292 void on_paste() { paste_state_ = PASTING; } |
293 | 293 |
294 // Returns true if pasting is in progress. | |
295 bool is_pasting() const { return paste_state_ == PASTING; } | |
296 | |
297 // Called when the user presses up or down. |count| is a repeat count, | 294 // Called when the user presses up or down. |count| is a repeat count, |
298 // negative for moving up, positive for moving down. | 295 // negative for moving up, positive for moving down. |
299 void OnUpOrDownKeyPressed(int count); | 296 void OnUpOrDownKeyPressed(int count); |
300 | 297 |
301 // Called when any relevant data changes. This rolls together several | 298 // Called when any relevant data changes. This rolls together several |
302 // separate pieces of data into one call so we can update all the UI | 299 // separate pieces of data into one call so we can update all the UI |
303 // efficiently: | 300 // efficiently: |
304 // |text| is either the new temporary text from the user manually selecting | 301 // |text| is either the new temporary text from the user manually selecting |
305 // a different match, or the inline autocomplete text. We distinguish by | 302 // a different match, or the inline autocomplete text. We distinguish by |
306 // checking if |destination_for_temporary_text_change| is NULL. | 303 // checking if |destination_for_temporary_text_change| is NULL. |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // It has no effect if a keyword is already selected. | 550 // It has no effect if a keyword is already selected. |
554 bool allow_exact_keyword_match_; | 551 bool allow_exact_keyword_match_; |
555 | 552 |
556 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. | 553 // Last value of InstantCompleteBehavior supplied to |SetSuggestedText|. |
557 InstantCompleteBehavior instant_complete_behavior_; | 554 InstantCompleteBehavior instant_complete_behavior_; |
558 | 555 |
559 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 556 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
560 }; | 557 }; |
561 | 558 |
562 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 559 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |