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

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

Issue 11833043: Instant Extended: Fallback to local preview if the remote instant page is not ready on user input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: Addressing sreeram's comments. 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 | « no previous file | chrome/browser/instant/instant_client.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_CLIENT_H_ 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_
6 #define CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ 6 #define CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // Called when the underlying RenderView crashes. 61 // Called when the underlying RenderView crashes.
62 virtual void RenderViewGone() = 0; 62 virtual void RenderViewGone() = 0;
63 63
64 // Called when the page is about to navigate. 64 // Called when the page is about to navigate.
65 virtual void AboutToNavigateMainFrame(const GURL& url) = 0; 65 virtual void AboutToNavigateMainFrame(const GURL& url) = 0;
66 66
67 // Called when the SearchBox wants to navigate to the specified URL. 67 // Called when the SearchBox wants to navigate to the specified URL.
68 virtual void NavigateToURL(const GURL& url, 68 virtual void NavigateToURL(const GURL& url,
69 content::PageTransition transition) = 0; 69 content::PageTransition transition) = 0;
70 70
71 // Called when a RenderView is created, so that state can be initialized.
72 virtual void RenderViewCreated() = 0;
73
71 protected: 74 protected:
72 virtual ~Delegate(); 75 virtual ~Delegate();
73 }; 76 };
74 77
75 // Doesn't take ownership of |delegate|. 78 // Doesn't take ownership of |delegate|.
76 explicit InstantClient(Delegate* delegate); 79 explicit InstantClient(Delegate* delegate);
77 virtual ~InstantClient(); 80 virtual ~InstantClient();
78 81
79 // Sets |contents| as the page to communicate with. |contents| can be NULL, 82 // Sets |contents| as the page to communicate with. |contents| can be NULL,
80 // which effectively stops all communication. 83 // which effectively stops all communication.
(...skipping 16 matching lines...) Expand all
97 void Cancel(const string16& text); 100 void Cancel(const string16& text);
98 101
99 // Tells the page the bounds of the omnibox dropdown (in screen coordinates). 102 // Tells the page the bounds of the omnibox dropdown (in screen coordinates).
100 // This is used by the page to offset the results to avoid them being covered 103 // This is used by the page to offset the results to avoid them being covered
101 // by the omnibox dropdown. 104 // by the omnibox dropdown.
102 void SetPopupBounds(const gfx::Rect& bounds); 105 void SetPopupBounds(const gfx::Rect& bounds);
103 106
104 // Tells the page what size start and end margins to use. 107 // Tells the page what size start and end margins to use.
105 void SetMarginSize(const int start, const int end); 108 void SetMarginSize(const int start, const int end);
106 109
110 // Tells the page about the font information.
111 void InitializeFonts();
112
107 // Tells the renderer to determine if the page supports the Instant API, which 113 // Tells the renderer to determine if the page supports the Instant API, which
108 // results in a call to InstantSupportDetermined() when the reply is received. 114 // results in a call to InstantSupportDetermined() when the reply is received.
109 void DetermineIfPageSupportsInstant(); 115 void DetermineIfPageSupportsInstant();
110 116
111 // Tells the page about the available autocomplete results. 117 // Tells the page about the available autocomplete results.
112 void SendAutocompleteResults( 118 void SendAutocompleteResults(
113 const std::vector<InstantAutocompleteResult>& results); 119 const std::vector<InstantAutocompleteResult>& results);
114 120
115 // Tells the page that the user pressed Up or Down in the omnibox. |count| is 121 // Tells the page that the user pressed Up or Down in the omnibox. |count| is
116 // a repeat count, negative for moving up, positive for moving down. 122 // a repeat count, negative for moving up, positive for moving down.
117 void UpOrDownKeyPressed(int count); 123 void UpOrDownKeyPressed(int count);
118 124
119 // Tells the page that the active tab's search mode has changed. 125 // Tells the page that the active tab's search mode has changed.
120 void SearchModeChanged(const chrome::search::Mode& mode); 126 void SearchModeChanged(const chrome::search::Mode& mode);
121 127
122 // Tells the page about the current theme background. 128 // Tells the page about the current theme background.
123 void SendThemeBackgroundInfo(const ThemeBackgroundInfo& theme_info); 129 void SendThemeBackgroundInfo(const ThemeBackgroundInfo& theme_info);
124 130
125 // Tells the page about the current theme area height. 131 // Tells the page about the current theme area height.
126 void SendThemeAreaHeight(int height); 132 void SendThemeAreaHeight(int height);
127 133
128 // Tells the page whether it is allowed to display Instant results. 134 // Tells the page whether it is allowed to display Instant results.
129 void SetDisplayInstantResults(bool display_instant_results); 135 void SetDisplayInstantResults(bool display_instant_results);
130 136
131 // Tells the page whether the browser is capturing user key strokes. 137 // Tells the page whether the browser is capturing user key strokes.
132 void KeyCaptureChanged(bool is_key_capture_enabled); 138 void KeyCaptureChanged(bool is_key_capture_enabled);
133 139
134 private: 140 private:
135 // Overridden from content::WebContentsObserver: 141 // Overridden from content::WebContentsObserver:
142 virtual void RenderViewCreated(
143 content::RenderViewHost* render_view_host) OVERRIDE;
136 virtual void DidFinishLoad( 144 virtual void DidFinishLoad(
137 int64 frame_id, 145 int64 frame_id,
138 const GURL& validated_url, 146 const GURL& validated_url,
139 bool is_main_frame, 147 bool is_main_frame,
140 content::RenderViewHost* render_view_host) OVERRIDE; 148 content::RenderViewHost* render_view_host) OVERRIDE;
141 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 149 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
142 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE; 150 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
143 virtual void DidCommitProvisionalLoadForFrame( 151 virtual void DidCommitProvisionalLoadForFrame(
144 int64 frame_id, 152 int64 frame_id,
145 bool is_main_frame, 153 bool is_main_frame,
(...skipping 12 matching lines...) Expand all
158 void StopCapturingKeyStrokes(int page_id); 166 void StopCapturingKeyStrokes(int page_id);
159 void SearchBoxNavigate(int page_id, const GURL& url, 167 void SearchBoxNavigate(int page_id, const GURL& url,
160 content::PageTransition transition); 168 content::PageTransition transition);
161 169
162 Delegate* const delegate_; 170 Delegate* const delegate_;
163 171
164 DISALLOW_COPY_AND_ASSIGN(InstantClient); 172 DISALLOW_COPY_AND_ASSIGN(InstantClient);
165 }; 173 };
166 174
167 #endif // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_ 175 #endif // CHROME_BROWSER_INSTANT_INSTANT_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/instant/instant_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698