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

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

Issue 6685002: Wires up ability for page to specify instant auto complete (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test and stray char Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/scoped_ptr.h" 13 #include "base/scoped_ptr.h"
14 #include "base/scoped_vector.h" 14 #include "base/scoped_vector.h"
15 #include "base/string16.h" 15 #include "base/string16.h"
16 #include "base/task.h" 16 #include "base/task.h"
17 #include "base/timer.h" 17 #include "base/timer.h"
18 #include "chrome/browser/instant/instant_commit_type.h" 18 #include "chrome/browser/instant/instant_commit_type.h"
19 #include "chrome/browser/instant/instant_loader_delegate.h" 19 #include "chrome/browser/instant/instant_loader_delegate.h"
20 #include "chrome/browser/search_engines/template_url_id.h" 20 #include "chrome/browser/search_engines/template_url_id.h"
21 #include "chrome/common/instant_types.h"
21 #include "chrome/common/page_transition_types.h" 22 #include "chrome/common/page_transition_types.h"
22 #include "googleurl/src/gurl.h" 23 #include "googleurl/src/gurl.h"
23 #include "ui/gfx/native_widget_types.h" 24 #include "ui/gfx/native_widget_types.h"
24 #include "ui/gfx/rect.h" 25 #include "ui/gfx/rect.h"
25 26
26 struct AutocompleteMatch; 27 struct AutocompleteMatch;
27 class InstantDelegate; 28 class InstantDelegate;
28 class InstantLoader; 29 class InstantLoader;
29 class InstantLoaderManager; 30 class InstantLoaderManager;
30 class InstantTest; 31 class InstantTest;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // (until the search provider loads, then both return true). 168 // (until the search provider loads, then both return true).
168 bool MightSupportInstant(); 169 bool MightSupportInstant();
169 170
170 // Returns the URL currently being loaded or shown if everything has finished 171 // Returns the URL currently being loaded or shown if everything has finished
171 // loading. 172 // loading.
172 GURL GetCurrentURL(); 173 GURL GetCurrentURL();
173 174
174 // InstantLoaderDelegate 175 // InstantLoaderDelegate
175 virtual void ShowInstantLoader(InstantLoader* loader) OVERRIDE; 176 virtual void ShowInstantLoader(InstantLoader* loader) OVERRIDE;
176 virtual void SetSuggestedTextFor(InstantLoader* loader, 177 virtual void SetSuggestedTextFor(InstantLoader* loader,
177 const string16& text) OVERRIDE; 178 const string16& text,
179 InstantCompleteBehavior behavior) OVERRIDE;
178 virtual gfx::Rect GetInstantBounds() OVERRIDE; 180 virtual gfx::Rect GetInstantBounds() OVERRIDE;
179 virtual bool ShouldCommitInstantOnMouseUp() OVERRIDE; 181 virtual bool ShouldCommitInstantOnMouseUp() OVERRIDE;
180 virtual void CommitInstantLoader(InstantLoader* loader) OVERRIDE; 182 virtual void CommitInstantLoader(InstantLoader* loader) OVERRIDE;
181 virtual void InstantLoaderDoesntSupportInstant( 183 virtual void InstantLoaderDoesntSupportInstant(
182 InstantLoader* loader) OVERRIDE; 184 InstantLoader* loader) OVERRIDE;
183 virtual void AddToBlacklist(InstantLoader* loader, 185 virtual void AddToBlacklist(InstantLoader* loader,
184 const GURL& url) OVERRIDE; 186 const GURL& url) OVERRIDE;
185 187
186 private: 188 private:
187 friend class InstantTest; 189 friend class InstantTest;
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 ScopedVector<InstantLoader> loaders_to_destroy_; 285 ScopedVector<InstantLoader> loaders_to_destroy_;
284 286
285 // The set of hosts that we don't use instant with. This is shared across all 287 // The set of hosts that we don't use instant with. This is shared across all
286 // instances and only maintained for the current session. 288 // instances and only maintained for the current session.
287 static HostBlacklist* host_blacklist_; 289 static HostBlacklist* host_blacklist_;
288 290
289 DISALLOW_COPY_AND_ASSIGN(InstantController); 291 DISALLOW_COPY_AND_ASSIGN(InstantController);
290 }; 292 };
291 293
292 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ 294 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698