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

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: Fix test failures. 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
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 // Doesn't take ownership of either |delegate|.
sreeram 2013/02/07 18:22:46 No need for this comment. As @dhollowa mentioned,
samarth 2013/02/07 22:11:55 Yep, yep. I keep missing some of these.
28 InstantTab(InstantController* controller, content::WebContents* contents); 17 explicit InstantTab(InstantPage::Delegate* delegate);
29 virtual ~InstantTab(); 18 virtual ~InstantTab();
30 19
31 content::WebContents* contents() const { return contents_; } 20 // 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. 21 // the page supports the Instant API.
35 void Init(); 22 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 23
50 private: 24 private:
51 // Overridden from InstantClient::Delegate: 25 // Overridden from InstantPage:
52 virtual void SetSuggestions( 26 virtual bool ShouldProcessRenderViewCreated() OVERRIDE;
53 const std::vector<InstantSuggestion>& suggestions) OVERRIDE; 27 virtual bool ShouldProcessRenderViewGone() OVERRIDE;
54 virtual void InstantSupportDetermined(bool supports_instant) OVERRIDE; 28 virtual bool ShouldProcessAboutToNavigateMainFrame() OVERRIDE;
55 virtual void ShowInstantPreview(InstantShownReason reason, 29 virtual bool ShouldProcessShowInstantPreview() 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 30
71 DISALLOW_COPY_AND_ASSIGN(InstantTab); 31 DISALLOW_COPY_AND_ASSIGN(InstantTab);
72 }; 32 };
73 33
74 #endif // CHROME_BROWSER_INSTANT_INSTANT_TAB_H_ 34 #endif // CHROME_BROWSER_INSTANT_INSTANT_TAB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698