OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // false a commit does not result in committing the last url passed to update. | 101 // false a commit does not result in committing the last url passed to update. |
102 // A return value of false happens if we're in the process of determining if | 102 // A return value of false happens if we're in the process of determining if |
103 // the page supports instant. | 103 // the page supports instant. |
104 bool IsCurrent(); | 104 bool IsCurrent(); |
105 | 105 |
106 // Returns true if the caller should proceed with committing the preview. A | 106 // Returns true if the caller should proceed with committing the preview. A |
107 // return value of false means that there is no valid preview to commit. This | 107 // return value of false means that there is no valid preview to commit. This |
108 // is used by Browser, when the user presses <Enter>, to decide whether to | 108 // is used by Browser, when the user presses <Enter>, to decide whether to |
109 // load the omnibox contents through Instant or otherwise. This is needed | 109 // load the omnibox contents through Instant or otherwise. This is needed |
110 // because calls to |Update| don't necessarily result in a preview being | 110 // because calls to |Update| don't necessarily result in a preview being |
111 // shown, such as in the HIDDEN field trial. | 111 // shown, such as in the HIDDEN and SILENT field trials. |
112 bool PrepareForCommit(); | 112 bool PrepareForCommit(); |
113 | 113 |
114 // Invoked when the user does some gesture that should trigger making the | 114 // Invoked when the user does some gesture that should trigger making the |
115 // current previewed page the permanent page. Returns the TCW that contains | 115 // current previewed page the permanent page. Returns the TCW that contains |
116 // the committed preview. | 116 // the committed preview. |
117 TabContentsWrapper* CommitCurrentPreview(InstantCommitType type); | 117 TabContentsWrapper* CommitCurrentPreview(InstantCommitType type); |
118 | 118 |
119 // Sets InstantController so that when the mouse is released the preview is | 119 // Sets InstantController so that when the mouse is released the preview is |
120 // committed. | 120 // committed. |
121 void SetCommitOnMouseUp(); | 121 void SetCommitOnMouseUp(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // The URL of the most recent match passed to |Update|. | 256 // The URL of the most recent match passed to |Update|. |
257 GURL last_url_; | 257 GURL last_url_; |
258 | 258 |
259 // The most recent user_text passed to |Update|. | 259 // The most recent user_text passed to |Update|. |
260 string16 last_user_text_; | 260 string16 last_user_text_; |
261 | 261 |
262 DISALLOW_COPY_AND_ASSIGN(InstantController); | 262 DISALLOW_COPY_AND_ASSIGN(InstantController); |
263 }; | 263 }; |
264 | 264 |
265 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 265 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |