Index: chrome/browser/managed_mode/managed_mode_interstitial.cc |
diff --git a/chrome/browser/managed_mode/managed_mode_interstitial.cc b/chrome/browser/managed_mode/managed_mode_interstitial.cc |
index 878d7c7e0aa58bce697a35e376f6448ce0e00026..ac1f537754587b7035f99ceb7ffd3d2630c6aec4 100644 |
--- a/chrome/browser/managed_mode/managed_mode_interstitial.cc |
+++ b/chrome/browser/managed_mode/managed_mode_interstitial.cc |
@@ -11,7 +11,6 @@ |
#include "chrome/browser/managed_mode/managed_user_service.h" |
#include "chrome/browser/managed_mode/managed_user_service_factory.h" |
#include "chrome/browser/profiles/profile.h" |
-#include "chrome/browser/tab_contents/tab_util.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/url_constants.h" |
#include "content/public/browser/browser_thread.h" |
@@ -28,44 +27,6 @@ |
using content::BrowserThread; |
-namespace { |
- |
-void ShowInterstitialOnUIThread(int render_process_host_id, |
- int render_view_id, |
- const GURL& url, |
- const base::Callback<void(bool)>& callback) { |
- // The tab might have been closed. |
- content::WebContents* web_contents = |
- tab_util::GetWebContentsByID(render_process_host_id, render_view_id); |
- if (!web_contents) { |
- BrowserThread::PostTask( |
- BrowserThread::IO, FROM_HERE, base::Bind(callback, true)); |
- return; |
- } |
- |
- ManagedModeNavigationObserver* navigation_observer = |
- ManagedModeNavigationObserver::FromWebContents(web_contents); |
- if (navigation_observer) |
- navigation_observer->SetStateToRecordingAfterPreview(); |
- |
- new ManagedModeInterstitial(web_contents, url, callback); |
-} |
- |
-} // namespace |
- |
-// static |
-void ManagedModeInterstitial::ShowInterstitial( |
- int render_process_host_id, |
- int render_view_id, |
- const GURL& url, |
- const base::Callback<void(bool)>& callback) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
- BrowserThread::PostTask( |
- BrowserThread::UI, FROM_HERE, |
- base::Bind(&ShowInterstitialOnUIThread, render_process_host_id, |
- render_view_id, url, callback)); |
-} |
- |
ManagedModeInterstitial::ManagedModeInterstitial( |
content::WebContents* web_contents, |
const GURL& url, |
@@ -164,20 +125,14 @@ void ManagedModeInterstitial::CommandReceived(const std::string& command) { |
} |
void ManagedModeInterstitial::OnProceed() { |
- DispatchContinueRequest(true); |
+ callback_.Run(true); |
} |
void ManagedModeInterstitial::OnDontProceed() { |
- DispatchContinueRequest(false); |
+ callback_.Run(false); |
} |
void ManagedModeInterstitial::OnAuthorizationResult(bool success) { |
if (success) |
interstitial_page_->Proceed(); |
} |
- |
-void ManagedModeInterstitial::DispatchContinueRequest(bool continue_request) { |
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
- base::Bind(callback_, continue_request)); |
-} |
- |