OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_TAB_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_TAB_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/compiler_specific.h" |
| 12 #include "base/string16.h" |
| 13 #include "chrome/browser/instant/instant_client.h" |
| 14 |
| 15 struct InstantAutocompleteResult; |
| 16 class InstantController; |
| 17 |
| 18 namespace content { |
| 19 class WebContents; |
| 20 } |
| 21 |
| 22 // InstantTab is used to communicate with a committed search results page, i.e., |
| 23 // an actual tab on the tab strip (compare: InstantLoader, which has a preview |
| 24 // page that appears and disappears as the user types in the omnibox). |
| 25 class InstantTab : public InstantClient::Delegate { |
| 26 public: |
| 27 // Doesn't take ownership of either |controller| or |contents|. |
| 28 InstantTab(InstantController* controller, content::WebContents* contents); |
| 29 virtual ~InstantTab(); |
| 30 |
| 31 content::WebContents* contents() const { return contents_; } |
| 32 |
| 33 // Calls through to methods of the same name on InstantClient. |
| 34 void Update(const string16& text, bool verbatim); |
| 35 void Submit(const string16& text); |
| 36 void SendAutocompleteResults( |
| 37 const std::vector<InstantAutocompleteResult>& results); |
| 38 void UpOrDownKeyPressed(int count); |
| 39 |
| 40 private: |
| 41 // Overridden from InstantClient::Delegate: |
| 42 virtual void SetSuggestions( |
| 43 const std::vector<InstantSuggestion>& suggestions) OVERRIDE; |
| 44 virtual void InstantSupportDetermined(bool supports_instant) OVERRIDE; |
| 45 virtual void ShowInstantPreview(InstantShownReason reason, |
| 46 int height, |
| 47 InstantSizeUnits units) OVERRIDE; |
| 48 |
| 49 InstantClient client_; |
| 50 InstantController* const controller_; |
| 51 content::WebContents* const contents_; |
| 52 bool supports_instant_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(InstantTab); |
| 55 }; |
| 56 |
| 57 #endif // CHROME_BROWSER_INSTANT_INSTANT_TAB_H_ |
OLD | NEW |