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

Side by Side Diff: chrome/renderer/searchbox/search_bouncer.h

Issue 23455047: InstantExtended: Send search URLs to renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Small test Created 7 years, 3 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
(Empty)
1 // Copyright (c) 2013 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_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
6 #define CHROME_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "content/public/renderer/render_process_observer.h"
12 #include "url/gurl.h"
13
14 namespace IPC {
15 class Message;
16 }
17
18 // SearchBouncer tracks a set of URLs which should be transferred back to the
19 // browser process for potential reassignment to an Instant renderer process.
20 class SearchBouncer : public content::RenderProcessObserver {
21 public:
22 SearchBouncer();
23 virtual ~SearchBouncer();
24
25 // Returns whether a navigation to |url| should bounce back to the browser as
26 // a potential Instant url. See chrome::ShouldAssignURLToInstantRenderer().
27 bool ShouldFork(const GURL& url) const;
28
29 // Returns whether |url| is a valid Instant new tab page URL.
30 bool IsNewTabPage(const GURL& url) const;
31
32 // Exposed for testing.
33 void OnSetSearchURLs(std::vector<GURL> search_urls, GURL new_tab_page_url);
34
35 private:
36 // From RenderProcessObserver:
37 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
38
39 // URLs to bounce back to the browser.
40 std::vector<GURL> search_urls_;
41 GURL new_tab_page_url_;
42
43 DISALLOW_COPY_AND_ASSIGN(SearchBouncer);
44 };
45
46 #endif // CHROME_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698