Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: chrome/browser/instant/instant_tab.h

Issue 11824050: InstantExtended: Committed NTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo to fix blacklisting. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/instant/instant_page.cc ('k') | chrome/browser/instant/instant_tab.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_TAB_H_ 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_TAB_H_
6 #define CHROME_BROWSER_INSTANT_INSTANT_TAB_H_ 6 #define CHROME_BROWSER_INSTANT_INSTANT_TAB_H_
7 7
8 #include <vector>
9
10 #include "base/basictypes.h" 8 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
12 #include "base/string16.h" 10 #include "chrome/browser/instant/instant_page.h"
13 #include "chrome/browser/instant/instant_client.h"
14 11
15 struct InstantAutocompleteResult; 12 // InstantTab represents a committed page (i.e. an actual tab on the tab strip)
16 class InstantController; 13 // that supports the Instant API.
17 14 class InstantTab : public InstantPage {
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: 15 public:
27 // Doesn't take ownership of either |controller| or |contents|. 16 explicit InstantTab(InstantPage::Delegate* delegate);
28 InstantTab(InstantController* controller, content::WebContents* contents);
29 virtual ~InstantTab(); 17 virtual ~InstantTab();
30 18
31 content::WebContents* contents() const { return contents_; } 19 // Start observing |contents| for messages. Sends a message to determine if
32
33 // Start observing |contents_| for messages. Sends a message to determine if
34 // the page supports the Instant API. 20 // the page supports the Instant API.
35 void Init(); 21 void Init(content::WebContents* contents);
36
37 // Calls through to methods of the same name on InstantClient.
38 void Update(const string16& text,
39 size_t selection_start,
40 size_t selection_end,
41 bool verbatim);
42 void Submit(const string16& text);
43 void SendAutocompleteResults(
44 const std::vector<InstantAutocompleteResult>& results);
45 void SetDisplayInstantResults(bool display_instant_results);
46 void UpOrDownKeyPressed(int count);
47 void SetMarginSize(int start, int end);
48 void InitializeFonts();
49 22
50 private: 23 private:
51 // Overridden from InstantClient::Delegate: 24 // Overridden from InstantPage:
52 virtual void SetSuggestions( 25 virtual bool ShouldProcessSetSuggestions() OVERRIDE;
53 const std::vector<InstantSuggestion>& suggestions) OVERRIDE; 26 virtual bool ShouldProcessStartCapturingKeyStrokes() OVERRIDE;
54 virtual void InstantSupportDetermined(bool supports_instant) OVERRIDE; 27 virtual bool ShouldProcessStopCapturingKeyStrokes() OVERRIDE;
55 virtual void ShowInstantPreview(InstantShownReason reason, 28 virtual bool ShouldProcessNavigateToURL() OVERRIDE;
56 int height,
57 InstantSizeUnits units) OVERRIDE;
58 virtual void StartCapturingKeyStrokes() OVERRIDE;
59 virtual void StopCapturingKeyStrokes() OVERRIDE;
60 virtual void RenderViewGone() OVERRIDE;
61 virtual void AboutToNavigateMainFrame(const GURL& url) OVERRIDE;
62 virtual void NavigateToURL(const GURL& url,
63 content::PageTransition transition) OVERRIDE;
64 virtual void RenderViewCreated() OVERRIDE;
65
66 InstantClient client_;
67 InstantController* const controller_;
68 content::WebContents* const contents_;
69 bool supports_instant_;
70 29
71 DISALLOW_COPY_AND_ASSIGN(InstantTab); 30 DISALLOW_COPY_AND_ASSIGN(InstantTab);
72 }; 31 };
73 32
74 #endif // CHROME_BROWSER_INSTANT_INSTANT_TAB_H_ 33 #endif // CHROME_BROWSER_INSTANT_INSTANT_TAB_H_
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_page.cc ('k') | chrome/browser/instant/instant_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698