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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/search_bouncer.h
diff --git a/chrome/renderer/searchbox/search_bouncer.h b/chrome/renderer/searchbox/search_bouncer.h
new file mode 100644
index 0000000000000000000000000000000000000000..47e3440541eb68c06afac74c2c2a68535920282b
--- /dev/null
+++ b/chrome/renderer/searchbox/search_bouncer.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
+#define CHROME_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/gtest_prod_util.h"
+#include "content/public/renderer/render_process_observer.h"
+#include "url/gurl.h"
+
+namespace IPC {
+class Message;
+}
+
+// SearchBouncer tracks a set of URLs which should be transferred back to the
+// browser process for potential reassignment to an Instant renderer process.
+class SearchBouncer : public content::RenderProcessObserver {
+ public:
+ SearchBouncer();
+ virtual ~SearchBouncer();
+
+ // Returns whether a navigation to |url| should bounce back to the browser as
+ // a potential Instant url. See chrome::ShouldAssignURLToInstantRenderer().
+ bool ShouldFork(const GURL& url) const;
+
+ // Returns whether |url| is a valid Instant new tab page URL.
+ bool IsNewTabPage(const GURL& url) const;
+
+ // Exposed for testing.
+ void OnSetSearchURLs(std::vector<GURL> search_urls, GURL new_tab_page_url);
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(SearchBouncerTest, SetSearchURLs);
+
+ // From RenderProcessObserver:
+ virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ // URLs to bounce back to the browser.
+ std::vector<GURL> search_urls_;
+ GURL new_tab_page_url_;
+
+ DISALLOW_COPY_AND_ASSIGN(SearchBouncer);
+};
+
+#endif // CHROME_RENDERER_SEARCHBOX_SEARCH_BOUNCER_H_
« 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