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

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: More browsertest fixes Created 7 years, 2 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 "base/gtest_prod_util.h"
12 #include "content/public/renderer/render_process_observer.h"
13 #include "url/gurl.h"
14
15 namespace IPC {
16 class Message;
17 }
18
19 // SearchBouncer tracks a set of URLs which should be transferred back to the
20 // browser process for potential reassignment to an Instant renderer process.
21 class SearchBouncer : public content::RenderProcessObserver {
22 public:
23 SearchBouncer();
24 virtual ~SearchBouncer();
25
26 // Returns whether a navigation to |url| should bounce back to the browser as
27 // a potential Instant url. See chrome::ShouldAssignURLToInstantRenderer().
28 bool ShouldFork(const GURL& url) const;
29
30 // Returns whether |url| is a valid Instant new tab page URL.
31 bool IsNewTabPage(const GURL& url) const;
32
33 // Exposed for testing.
34 void OnSetSearchURLs(std::vector<GURL> search_urls, GURL new_tab_page_url);
35
36 private:
37 FRIEND_TEST_ALL_PREFIXES(SearchBouncerTest, SetSearchURLs);
38
39 // From RenderProcessObserver:
40 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
41
42 // URLs to bounce back to the browser.
43 std::vector<GURL> search_urls_;
44 GURL new_tab_page_url_;
45
46 DISALLOW_COPY_AND_ASSIGN(SearchBouncer);
47 };
48
49 #endif // CHROME_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
OLDNEW
« no previous file with comments | « chrome/renderer/media/webrtc_logging_message_filter.cc ('k') | chrome/renderer/searchbox/search_bouncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698