OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Returns true if the caller should proceed with committing the preview. A | 115 // Returns true if the caller should proceed with committing the preview. A |
116 // return value of false means that there is no valid preview to commit. This | 116 // return value of false means that there is no valid preview to commit. This |
117 // is used by Browser, when the user presses <Enter>, to decide whether to | 117 // is used by Browser, when the user presses <Enter>, to decide whether to |
118 // load the omnibox contents through Instant or otherwise. This is needed | 118 // load the omnibox contents through Instant or otherwise. This is needed |
119 // because calls to |Update| don't necessarily result in a preview being | 119 // because calls to |Update| don't necessarily result in a preview being |
120 // shown, such as in the HIDDEN and SILENT modes. | 120 // shown, such as in the HIDDEN and SILENT modes. |
121 bool PrepareForCommit(); | 121 bool PrepareForCommit(); |
122 | 122 |
123 // Invoked when the user does some gesture that should trigger making the | 123 // Invoked when the user does some gesture that should trigger making the |
124 // current previewed page the permanent page. Returns the TCW that contains | 124 // current previewed page the permanent page. Returns the TabContents that |
125 // the committed preview. | 125 // contains the committed preview. |
126 TabContents* CommitCurrentPreview(InstantCommitType type); | 126 TabContents* CommitCurrentPreview(InstantCommitType type); |
127 | 127 |
128 // Accepts the currently showing instant preview, if any, and returns true. | 128 // Accepts the currently showing instant preview, if any, and returns true. |
129 // Returns false if there is no instant preview showing. | 129 // Returns false if there is no instant preview showing. |
130 bool CommitIfCurrent(); | 130 bool CommitIfCurrent(); |
131 | 131 |
132 // Sets InstantController so that when the mouse is released the preview is | 132 // Sets InstantController so that when the mouse is released the preview is |
133 // committed. | 133 // committed. |
134 void SetCommitOnMouseUp(); | 134 void SetCommitOnMouseUp(); |
135 | 135 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // The most recent user_text passed to |Update|. | 268 // The most recent user_text passed to |Update|. |
269 string16 last_user_text_; | 269 string16 last_user_text_; |
270 | 270 |
271 // See the enum description above. | 271 // See the enum description above. |
272 const Mode mode_; | 272 const Mode mode_; |
273 | 273 |
274 DISALLOW_COPY_AND_ASSIGN(InstantController); | 274 DISALLOW_COPY_AND_ASSIGN(InstantController); |
275 }; | 275 }; |
276 | 276 |
277 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 277 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |