OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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_TAB_CONTENTS_WEB_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ |
6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Stops the current Find operation. If |clear_selection| is true, it will | 205 // Stops the current Find operation. If |clear_selection| is true, it will |
206 // also clear the selection on the focused frame. | 206 // also clear the selection on the focused frame. |
207 void StopFinding(bool clear_selection); | 207 void StopFinding(bool clear_selection); |
208 | 208 |
209 // Accessors/Setters for find_ui_active_. | 209 // Accessors/Setters for find_ui_active_. |
210 bool find_ui_active() const { return find_ui_active_; } | 210 bool find_ui_active() const { return find_ui_active_; } |
211 void set_find_ui_active(bool find_ui_active) { | 211 void set_find_ui_active(bool find_ui_active) { |
212 find_ui_active_ = find_ui_active; | 212 find_ui_active_ = find_ui_active; |
213 } | 213 } |
214 | 214 |
| 215 // Setter for find_op_aborted_. |
| 216 void set_find_op_aborted(bool find_op_aborted) { |
| 217 find_op_aborted_ = find_op_aborted; |
| 218 } |
| 219 |
215 // Used _only_ by testing to set the current request ID, since it calls | 220 // Used _only_ by testing to set the current request ID, since it calls |
216 // StartFinding on the RenderViewHost directly, rather than by using | 221 // StartFinding on the RenderViewHost directly, rather than by using |
217 // StartFinding's more limited API. | 222 // StartFinding's more limited API. |
218 void set_current_find_request_id(int current_find_request_id) { | 223 void set_current_find_request_id(int current_find_request_id) { |
219 current_find_request_id_ = current_find_request_id; | 224 current_find_request_id_ = current_find_request_id; |
220 } | 225 } |
221 | 226 |
222 // Accessor for find_text_. Used to determine if this WebContents has any | 227 // Accessor for find_text_. Used to determine if this WebContents has any |
223 // active searches. | 228 // active searches. |
224 string16 find_text() const { return find_text_; } | 229 string16 find_text() const { return find_text_; } |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 679 |
675 // The current load state and the URL associated with it. | 680 // The current load state and the URL associated with it. |
676 net::LoadState load_state_; | 681 net::LoadState load_state_; |
677 std::wstring load_state_host_; | 682 std::wstring load_state_host_; |
678 | 683 |
679 // True if the Find UI is active for this Tab. | 684 // True if the Find UI is active for this Tab. |
680 bool find_ui_active_; | 685 bool find_ui_active_; |
681 | 686 |
682 // True if a Find operation was aborted. This can happen if the Find box is | 687 // True if a Find operation was aborted. This can happen if the Find box is |
683 // closed or if the search term inside the Find box is erased while a search | 688 // closed or if the search term inside the Find box is erased while a search |
684 // is in progress. | 689 // is in progress. This can also be set if a page has been reloaded, and will |
| 690 // on FindNext result in a full Find operation so that the highlighting for |
| 691 // inactive matches can be repainted. |
685 bool find_op_aborted_; | 692 bool find_op_aborted_; |
686 | 693 |
687 // Each time a search request comes in we assign it an id before passing it | 694 // Each time a search request comes in we assign it an id before passing it |
688 // over the IPC so that when the results come in we can evaluate whether we | 695 // over the IPC so that when the results come in we can evaluate whether we |
689 // still care about the results of the search (in some cases we don't because | 696 // still care about the results of the search (in some cases we don't because |
690 // the user has issued a new search). | 697 // the user has issued a new search). |
691 static int find_request_id_counter_; | 698 static int find_request_id_counter_; |
692 | 699 |
693 // This variable keeps track of what the most recent request id is. | 700 // This variable keeps track of what the most recent request id is. |
694 int current_find_request_id_; | 701 int current_find_request_id_; |
695 | 702 |
696 // The last string we searched for. This is used to figure out if this is a | 703 // The last string we searched for. This is used to figure out if this is a |
697 // Find or a FindNext operation (FindNext should not increase the request id). | 704 // Find or a FindNext operation (FindNext should not increase the request id). |
698 string16 find_text_; | 705 string16 find_text_; |
699 | 706 |
700 // The last find result. This object contains details about the number of | 707 // The last find result. This object contains details about the number of |
701 // matches, the find selection rectangle, etc. The UI can access this | 708 // matches, the find selection rectangle, etc. The UI can access this |
702 // information to build its presentation. | 709 // information to build its presentation. |
703 FindNotificationDetails find_result_; | 710 FindNotificationDetails find_result_; |
704 | 711 |
705 DISALLOW_COPY_AND_ASSIGN(WebContents); | 712 DISALLOW_COPY_AND_ASSIGN(WebContents); |
706 }; | 713 }; |
707 | 714 |
708 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ | 715 #endif // CHROME_BROWSER_TAB_CONTENTS_WEB_CONTENTS_H_ |
OLD | NEW |