| 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 <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 class BrowserInstantController; | 27 class BrowserInstantController; |
| 28 class InstantService; | 28 class InstantService; |
| 29 class InstantTab; | 29 class InstantTab; |
| 30 class Profile; | 30 class Profile; |
| 31 | 31 |
| 32 namespace content { | 32 namespace content { |
| 33 class WebContents; | 33 class WebContents; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace gfx { |
| 37 class Rect; |
| 38 } |
| 39 |
| 36 // Macro used for logging debug events. |message| should be a std::string. | 40 // Macro used for logging debug events. |message| should be a std::string. |
| 37 #define LOG_INSTANT_DEBUG_EVENT(controller, message) \ | 41 #define LOG_INSTANT_DEBUG_EVENT(controller, message) \ |
| 38 controller->LogDebugEvent(message) | 42 controller->LogDebugEvent(message) |
| 39 | 43 |
| 40 // InstantController drives Chrome Instant, i.e., the browser implementation of | 44 // InstantController drives Chrome Instant, i.e., the browser implementation of |
| 41 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). | 45 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). |
| 42 // | 46 // |
| 43 // In extended mode, InstantController maintains and coordinates an InstantTab | 47 // In extended mode, InstantController maintains and coordinates an InstantTab |
| 44 // instance of InstantPage. An InstantTab instance points to the currently | 48 // instance of InstantPage. An InstantTab instance points to the currently |
| 45 // active tab, if it supports the Embedded Search API. InstantTab is backed by a | 49 // active tab, if it supports the Embedded Search API. InstantTab is backed by a |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void LogDebugEvent(const std::string& info) const; | 90 void LogDebugEvent(const std::string& info) const; |
| 87 | 91 |
| 88 // Resets list of debug events. | 92 // Resets list of debug events. |
| 89 void ClearDebugEvents(); | 93 void ClearDebugEvents(); |
| 90 | 94 |
| 91 // See comments for |debug_events_| below. | 95 // See comments for |debug_events_| below. |
| 92 const std::list<std::pair<int64, std::string> >& debug_events() { | 96 const std::list<std::pair<int64, std::string> >& debug_events() { |
| 93 return debug_events_; | 97 return debug_events_; |
| 94 } | 98 } |
| 95 | 99 |
| 100 // Gets the stored start-edge margin and width of the omnibox. |
| 101 const gfx::Rect omnibox_bounds() { |
| 102 return omnibox_bounds_; |
| 103 } |
| 104 |
| 96 // Used by BrowserInstantController to notify InstantController about the | 105 // Used by BrowserInstantController to notify InstantController about the |
| 97 // instant support change event for the active web contents. | 106 // instant support change event for the active web contents. |
| 98 void InstantSupportChanged(InstantSupportState instant_support); | 107 void InstantSupportChanged(InstantSupportState instant_support); |
| 99 | 108 |
| 100 protected: | 109 protected: |
| 101 // Accessors are made protected for testing purposes. | 110 // Accessors are made protected for testing purposes. |
| 102 virtual InstantTab* instant_tab() const; | 111 virtual InstantTab* instant_tab() const; |
| 103 | 112 |
| 104 virtual Profile* profile() const; | 113 virtual Profile* profile() const; |
| 105 | 114 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // its suggestions with the omnibox. | 220 // its suggestions with the omnibox. |
| 212 gfx::Rect omnibox_bounds_; | 221 gfx::Rect omnibox_bounds_; |
| 213 | 222 |
| 214 // List of events and their timestamps, useful in debugging Instant behaviour. | 223 // List of events and their timestamps, useful in debugging Instant behaviour. |
| 215 mutable std::list<std::pair<int64, std::string> > debug_events_; | 224 mutable std::list<std::pair<int64, std::string> > debug_events_; |
| 216 | 225 |
| 217 DISALLOW_COPY_AND_ASSIGN(InstantController); | 226 DISALLOW_COPY_AND_ASSIGN(InstantController); |
| 218 }; | 227 }; |
| 219 | 228 |
| 220 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ | 229 #endif // CHROME_BROWSER_UI_SEARCH_INSTANT_CONTROLLER_H_ |
| OLD | NEW |