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_INSTANT_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 22 matching lines...) Expand all Loading... |
33 class InstantNTP; | 33 class InstantNTP; |
34 class InstantOverlay; | 34 class InstantOverlay; |
35 class InstantTab; | 35 class InstantTab; |
36 class TemplateURL; | 36 class TemplateURL; |
37 | 37 |
38 namespace chrome { | 38 namespace chrome { |
39 class BrowserInstantController; | 39 class BrowserInstantController; |
40 } | 40 } |
41 | 41 |
42 namespace content { | 42 namespace content { |
| 43 class NavigationEntry; |
43 class WebContents; | 44 class WebContents; |
44 } | 45 } |
45 | 46 |
46 // Macro used for logging debug events. |message| should be a std::string. | 47 // Macro used for logging debug events. |message| should be a std::string. |
47 #define LOG_INSTANT_DEBUG_EVENT(controller, message) \ | 48 #define LOG_INSTANT_DEBUG_EVENT(controller, message) \ |
48 controller->LogDebugEvent(message) | 49 controller->LogDebugEvent(message) |
49 | 50 |
50 // InstantController drives Chrome Instant, i.e., the browser implementation of | 51 // InstantController drives Chrome Instant, i.e., the browser implementation of |
51 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). | 52 // the Embedded Search API (see http://dev.chromium.org/embeddedsearch). |
52 // | 53 // |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // Like HideOverlay(), but doesn't call OnStaleOverlay(). Use HideOverlay() | 258 // Like HideOverlay(), but doesn't call OnStaleOverlay(). Use HideOverlay() |
258 // unless you are going to call overlay_.reset() yourself subsequently. | 259 // unless you are going to call overlay_.reset() yourself subsequently. |
259 void HideInternal(); | 260 void HideInternal(); |
260 | 261 |
261 // Counterpart to HideOverlay(). Asks the |browser_| to display the preview | 262 // Counterpart to HideOverlay(). Asks the |browser_| to display the preview |
262 // with the given |height| in |units|. | 263 // with the given |height| in |units|. |
263 void ShowOverlay(InstantShownReason reason, | 264 void ShowOverlay(InstantShownReason reason, |
264 int height, | 265 int height, |
265 InstantSizeUnits units); | 266 InstantSizeUnits units); |
266 | 267 |
| 268 // Copies the loader's active NavigationEntry into a transient history entry |
| 269 // for the active tab. Used to update the tab title and make the back button |
| 270 // work as expected when the preview is shown at full height but not yet |
| 271 // committed. |
| 272 void SetTransientHistoryEntry(); |
| 273 |
| 274 // Updates the URL in the transient history entry for the overlay. |
| 275 void UpdateTransientHistoryEntry(const GURL& url); |
| 276 |
| 277 // Discards any transient history entry set by Instant. |
| 278 // See SetTransientHistoryEntry(). |
| 279 void ResetTransientHistoryEntry(); |
| 280 |
267 // Send the omnibox popup bounds to the page. | 281 // Send the omnibox popup bounds to the page. |
268 void SendPopupBoundsToPage(); | 282 void SendPopupBoundsToPage(); |
269 | 283 |
270 // Determines the Instant URL based on a number of factors: | 284 // Determines the Instant URL based on a number of factors: |
271 // If |extended_enabled_|: | 285 // If |extended_enabled_|: |
272 // - If |use_local_preview_only_| is true return kLocalOmniboxPopupURL, else | 286 // - If |use_local_preview_only_| is true return kLocalOmniboxPopupURL, else |
273 // - If the Instant URL is specified by command line, returns it, else | 287 // - If the Instant URL is specified by command line, returns it, else |
274 // - If the default Instant URL is present returns it. | 288 // - If the default Instant URL is present returns it. |
275 // If !|extended_enabled_|: | 289 // If !|extended_enabled_|: |
276 // - If the Instant URL is specified by command line, returns it, else | 290 // - If the Instant URL is specified by command line, returns it, else |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 base::Time first_interaction_time_; | 398 base::Time first_interaction_time_; |
385 | 399 |
386 // Whether to allow the preview to show search suggestions. In general, the | 400 // Whether to allow the preview to show search suggestions. In general, the |
387 // preview is allowed to show search suggestions whenever |search_mode_| is | 401 // preview is allowed to show search suggestions whenever |search_mode_| is |
388 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. | 402 // MODE_SEARCH_SUGGESTIONS, except in those cases where this is false. |
389 bool allow_preview_to_show_search_suggestions_; | 403 bool allow_preview_to_show_search_suggestions_; |
390 | 404 |
391 // List of events and their timestamps, useful in debugging Instant behaviour. | 405 // List of events and their timestamps, useful in debugging Instant behaviour. |
392 mutable std::list<std::pair<int64, std::string> > debug_events_; | 406 mutable std::list<std::pair<int64, std::string> > debug_events_; |
393 | 407 |
| 408 // True iff Instant has set a transient history entry for the active tab. |
| 409 bool instant_set_transient_entry_; |
| 410 |
394 DISALLOW_COPY_AND_ASSIGN(InstantController); | 411 DISALLOW_COPY_AND_ASSIGN(InstantController); |
395 }; | 412 }; |
396 | 413 |
397 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 414 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |