| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_UI_SEARCH_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 // The search mode in the active tab has changed. Bind |instant_tab_| if the | 58 // The search mode in the active tab has changed. Bind |instant_tab_| if the |
| 59 // |new_mode| reflects an Instant search results page. | 59 // |new_mode| reflects an Instant search results page. |
| 60 void SearchModeChanged(const SearchMode& old_mode, | 60 void SearchModeChanged(const SearchMode& old_mode, |
| 61 const SearchMode& new_mode); | 61 const SearchMode& new_mode); |
| 62 | 62 |
| 63 // The user switched tabs. Bind |instant_tab_| if the newly active tab is an | 63 // The user switched tabs. Bind |instant_tab_| if the newly active tab is an |
| 64 // Instant search results page. | 64 // Instant search results page. |
| 65 void ActiveTabChanged(); | 65 void ActiveTabChanged(); |
| 66 | 66 |
| 67 // The user is about to switch tabs. | |
| 68 void TabDeactivated(content::WebContents* contents); | |
| 69 | |
| 70 // Adds a new event to |debug_events_| and also DVLOG's it. Ensures that | 67 // Adds a new event to |debug_events_| and also DVLOG's it. Ensures that |
| 71 // |debug_events_| doesn't get too large. | 68 // |debug_events_| doesn't get too large. |
| 72 void LogDebugEvent(const std::string& info) const; | 69 void LogDebugEvent(const std::string& info) const; |
| 73 | 70 |
| 74 // Resets list of debug events. | 71 // Resets list of debug events. |
| 75 void ClearDebugEvents(); | 72 void ClearDebugEvents(); |
| 76 | 73 |
| 77 // See comments for |debug_events_| below. | 74 // See comments for |debug_events_| below. |
| 78 const std::list<std::pair<int64_t, std::string>>& debug_events() { | 75 const std::list<std::pair<int64_t, std::string>>& debug_events() { |
| 79 return debug_events_; | 76 return debug_events_; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // The search model mode for the active tab. | 143 // The search model mode for the active tab. |
| 147 SearchMode search_mode_; | 144 SearchMode search_mode_; |
| 148 | 145 |
| 149 // List of events and their timestamps, useful in debugging Instant behaviour. | 146 // List of events and their timestamps, useful in debugging Instant behaviour. |
| 150 mutable std::list<std::pair<int64_t, std::string>> debug_events_; | 147 mutable std::list<std::pair<int64_t, std::string>> debug_events_; |
| 151 | 148 |
| 152 DISALLOW_COPY_AND_ASSIGN(InstantController); | 149 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 153 }; | 150 }; |
| 154 | 151 |
| 155 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 152 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| OLD | NEW |