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

Unified Diff: chrome/browser/resource_coordinator/tab_navigation_throttle.h

Issue 2931023002: [TooManyTabs] Add TabNavigationThrottle (Closed)
Patch Set: Created 3 years, 6 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
Index: chrome/browser/resource_coordinator/tab_navigation_throttle.h
diff --git a/chrome/browser/resource_coordinator/tab_navigation_throttle.h b/chrome/browser/resource_coordinator/tab_navigation_throttle.h
new file mode 100644
index 0000000000000000000000000000000000000000..0aa1bffef68959b453002d50fd70e73f58dddaa2
--- /dev/null
+++ b/chrome/browser/resource_coordinator/tab_navigation_throttle.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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_BROWSER_RESOURCE_COORDINATOR_TAB_NAVIGATION_THROTTLE_H_
+#define CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_NAVIGATION_THROTTLE_H_
+
+#include <memory>
+
+#include "base/macros.h"
+#include "content/public/browser/navigation_throttle.h"
+
+namespace resource_coordinator {
+
+// TabNavigationThrottle plumbs navigation information to TabManager and enables
+// TabManager to control navigation for background tabs.
Charlie Reis 2017/06/10 00:53:36 Can you elaborate on this a bit more? "Controllin
Zhen Wang 2017/06/13 23:33:21 I replaced "control" with "delay". We indeed just
+class TabNavigationThrottle : public content::NavigationThrottle {
Charlie Reis 2017/06/10 00:53:36 This name seems too broad, since most navigation t
Zhen Wang 2017/06/13 23:33:21 SG. Renamed.
+ public:
+ static std::unique_ptr<TabNavigationThrottle> MaybeCreateThrottleFor(
+ content::NavigationHandle* navigation_handle);
+
+ explicit TabNavigationThrottle(content::NavigationHandle* navigation_handle);
+ ~TabNavigationThrottle() override;
+
+ // content::NavigationThrottle implementation
+ const char* GetNameForLogging() override;
+ content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TabNavigationThrottle);
+};
+
+} // namespace resource_coordinator
+
+#endif // CHROME_BROWSER_RESOURCE_COORDINATOR_TAB_NAVIGATION_THROTTLE_H_

Powered by Google App Engine
This is Rietveld 408576698