OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 7 |
8 #include "chrome/browser/autocomplete/autocomplete.h" | 8 #include "chrome/browser/autocomplete/autocomplete.h" |
9 #include "chrome/common/notification_registrar.h" | 9 #include "chrome/common/notification_registrar.h" |
10 #include "chrome/common/page_transition_types.h" | 10 #include "chrome/common/page_transition_types.h" |
(...skipping 129 matching lines...) Loading... |
140 AutocompleteMatch::Type CurrentTextType() const; | 140 AutocompleteMatch::Type CurrentTextType() const; |
141 | 141 |
142 // Returns true if |text| (which is display text in the current context) | 142 // Returns true if |text| (which is display text in the current context) |
143 // parses as a URL, and in that case sets |url| to the calculated URL. | 143 // parses as a URL, and in that case sets |url| to the calculated URL. |
144 // Subtle note: This ignores the desired_tld_ (unlike GetDataForURLExport() | 144 // Subtle note: This ignores the desired_tld_ (unlike GetDataForURLExport() |
145 // and CurrentTextIsURL()). The view needs this because it calls this | 145 // and CurrentTextIsURL()). The view needs this because it calls this |
146 // function during copy handling, when the control key is down to trigger the | 146 // function during copy handling, when the control key is down to trigger the |
147 // copy. | 147 // copy. |
148 bool GetURLForText(const std::wstring& text, GURL* url) const; | 148 bool GetURLForText(const std::wstring& text, GURL* url) const; |
149 | 149 |
| 150 // Invoked to adjust the text before writting to the clipboard for a copy |
| 151 // (e.g. by adding 'http' to the front). |sel_start| gives the start of the |
| 152 // selection. |text| is the currently selected text. If |is_all_selected| is |
| 153 // true all the text in the edit is selected. If the url should be copied to |
| 154 // the clipboard |write_url| is set to true and |url| set to the url to write. |
| 155 void AdjustTextForCopy(int sel_start, |
| 156 bool is_all_selected, |
| 157 std::wstring* text, |
| 158 GURL* url, |
| 159 bool* write_url); |
| 160 |
150 bool user_input_in_progress() const { return user_input_in_progress_; } | 161 bool user_input_in_progress() const { return user_input_in_progress_; } |
151 | 162 |
152 // Sets the state of user_input_in_progress_, and notifies the observer if | 163 // Sets the state of user_input_in_progress_, and notifies the observer if |
153 // that state has changed. | 164 // that state has changed. |
154 void SetInputInProgress(bool in_progress); | 165 void SetInputInProgress(bool in_progress); |
155 | 166 |
156 // Updates permanent_text_ to |new_permanent_text|. Returns true if this | 167 // Updates permanent_text_ to |new_permanent_text|. Returns true if this |
157 // change should be immediately user-visible, because either the user is not | 168 // change should be immediately user-visible, because either the user is not |
158 // editing or the edit does not have focus. | 169 // editing or the edit does not have focus. |
159 bool UpdatePermanentText(const std::wstring& new_permanent_text); | 170 bool UpdatePermanentText(const std::wstring& new_permanent_text); |
(...skipping 265 matching lines...) Loading... |
425 mutable GURL paste_and_go_url_; | 436 mutable GURL paste_and_go_url_; |
426 mutable PageTransition::Type paste_and_go_transition_; | 437 mutable PageTransition::Type paste_and_go_transition_; |
427 mutable GURL paste_and_go_alternate_nav_url_; | 438 mutable GURL paste_and_go_alternate_nav_url_; |
428 | 439 |
429 Profile* profile_; | 440 Profile* profile_; |
430 | 441 |
431 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); | 442 DISALLOW_COPY_AND_ASSIGN(AutocompleteEditModel); |
432 }; | 443 }; |
433 | 444 |
434 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ | 445 #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_EDIT_H_ |
OLD | NEW |