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

Unified Diff: chrome/browser/android/webapps/single_tab_mode_tab_helper.h

Issue 2821473002: Service CreateNewWindow on the UI thread with a new mojo interface (Closed)
Patch Set: MakeShared goodness Created 3 years, 8 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/android/webapps/single_tab_mode_tab_helper.h
diff --git a/chrome/browser/android/webapps/single_tab_mode_tab_helper.h b/chrome/browser/android/webapps/single_tab_mode_tab_helper.h
index 787667b107f1be74a5b4878a25204b56405fc37c..b1db3427309fa622934aaf10682921391c20324e 100644
--- a/chrome/browser/android/webapps/single_tab_mode_tab_helper.h
+++ b/chrome/browser/android/webapps/single_tab_mode_tab_helper.h
@@ -5,44 +5,32 @@
#ifndef CHROME_BROWSER_ANDROID_WEBAPPS_SINGLE_TAB_MODE_TAB_HELPER_H_
#define CHROME_BROWSER_ANDROID_WEBAPPS_SINGLE_TAB_MODE_TAB_HELPER_H_
-#include <stdint.h>
-
-#include <set>
-
-#include "base/compiler_specific.h"
#include "base/macros.h"
#include "chrome/browser/ui/blocked_content/blocked_window_params.h"
-#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
-// Registers and unregisters the IDs of renderers in single tab mode, which
-// are disallowed from opening new windows via
-// ChromeContentBrowserClient::CanCreateWindow().
+namespace content {
+class WebContents;
+}
+
+// Tracks tabs in single tab mode, which are disallowed from opening new windows
+// via ChromeContentBrowserClient::CanCreateWindow().
class SingleTabModeTabHelper
- : public content::WebContentsObserver,
- public content::WebContentsUserData<SingleTabModeTabHelper> {
+ : public content::WebContentsUserData<SingleTabModeTabHelper> {
public:
- // Checks if the ID pair is blocked from creating new windows. IO-thread only.
- static bool IsRegistered(int32_t process_id, int32_t routing_id);
-
~SingleTabModeTabHelper() override;
- // Handles opening the given URL through the TabModel.
- void HandleOpenUrl(const BlockedWindowParams& params);
+ bool block_all_new_windows() const { return block_all_new_windows_; }
// Permanently block this WebContents from creating new windows -- there is no
// current need to allow toggling this flag on or off.
void PermanentlyBlockAllNewWindows();
- // content::WebContentsObserver
- void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
- void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
-
private:
explicit SingleTabModeTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<SingleTabModeTabHelper>;
- bool block_all_new_windows_;
+ bool block_all_new_windows_ = false;
DISALLOW_COPY_AND_ASSIGN(SingleTabModeTabHelper);
};

Powered by Google App Engine
This is Rietveld 408576698