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

Unified Diff: chrome/browser/ui/external_protocol_dialog_delegate.cc

Issue 2623033006: [Re-landing] Migrate external protocol prefs from local state to profiles (Closed)
Patch Set: a Created 3 years, 11 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/ui/external_protocol_dialog_delegate.cc
diff --git a/chrome/browser/ui/external_protocol_dialog_delegate.cc b/chrome/browser/ui/external_protocol_dialog_delegate.cc
index 20c662fd7872ba0a391b06e51ce28d1c877b9fdb..b7cd418aea6a34e8afd3ca9bdd0fb2084d852f0e 100644
--- a/chrome/browser/ui/external_protocol_dialog_delegate.cc
+++ b/chrome/browser/ui/external_protocol_dialog_delegate.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/external_protocol_dialog_delegate.h"
#include "chrome/browser/external_protocol/external_protocol_handler.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -61,21 +62,31 @@ base::string16 ExternalProtocolDialogDelegate::GetTitleText() const {
void ExternalProtocolDialogDelegate::DoAccept(const GURL& url,
bool dont_block) const {
+ content::WebContents* web_contents = tab_util::GetWebContentsByID(
+ render_process_host_id_, render_view_routing_id_);
+
if (dont_block) {
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+
ExternalProtocolHandler::SetBlockState(url.scheme(),
- ExternalProtocolHandler::DONT_BLOCK);
+ ExternalProtocolHandler::DONT_BLOCK,
+ profile);
}
- content::WebContents* web_contents = tab_util::GetWebContentsByID(
- render_process_host_id_, render_view_routing_id_);
-
ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(url, web_contents);
}
void ExternalProtocolDialogDelegate::DoCancel(const GURL& url,
bool dont_block) const {
if (dont_block) {
+ content::WebContents* web_contents = tab_util::GetWebContentsByID(
+ render_process_host_id_, render_view_routing_id_);
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
+
ExternalProtocolHandler::SetBlockState(url.scheme(),
- ExternalProtocolHandler::BLOCK);
+ ExternalProtocolHandler::BLOCK,
+ profile);
}
}

Powered by Google App Engine
This is Rietveld 408576698