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

Side by Side Diff: chrome/browser/ui/android/content_settings/subresource_filter_infobar_delegate.cc

Issue 2890253002: [subresource_filter] Move OnReloadRequested to the ChromeClient (Closed)
Patch Set: remove from the base class Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/android/content_settings/subresource_filter_infobar_ delegate.h" 5 #include "chrome/browser/ui/android/content_settings/subresource_filter_infobar_ delegate.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/android/android_theme_resources.h" 9 #include "chrome/browser/android/android_theme_resources.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
11 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h" 11 #include "chrome/browser/subresource_filter/chrome_subresource_filter_client.h"
12 #include "chrome/grit/generated_resources.h" 12 #include "chrome/grit/generated_resources.h"
13 #include "components/infobars/core/infobar.h" 13 #include "components/infobars/core/infobar.h"
14 #include "components/strings/grit/components_strings.h" 14 #include "components/strings/grit/components_strings.h"
15 #include "components/subresource_filter/content/browser/content_subresource_filt er_driver_factory.h"
16 #include "components/subresource_filter/core/browser/subresource_filter_features .h" 15 #include "components/subresource_filter/core/browser/subresource_filter_features .h"
17 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
18 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
19 18
20 // static 19 // static
21 void SubresourceFilterInfobarDelegate::Create(InfoBarService* infobar_service) { 20 void SubresourceFilterInfobarDelegate::Create(InfoBarService* infobar_service) {
22 infobar_service->AddInfoBar(CreateSubresourceFilterInfoBar( 21 infobar_service->AddInfoBar(CreateSubresourceFilterInfoBar(
23 base::WrapUnique(new SubresourceFilterInfobarDelegate()))); 22 base::WrapUnique(new SubresourceFilterInfobarDelegate())));
24 } 23 }
25 24
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 71
73 return l10n_util::GetStringUTF16( 72 return l10n_util::GetStringUTF16(
74 using_experimental_infobar_ 73 using_experimental_infobar_
75 ? IDS_APP_MENU_RELOAD 74 ? IDS_APP_MENU_RELOAD
76 : IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD); 75 : IDS_FILTERED_DECEPTIVE_CONTENT_PROMPT_RELOAD);
77 } 76 }
78 77
79 bool SubresourceFilterInfobarDelegate::Cancel() { 78 bool SubresourceFilterInfobarDelegate::Cancel() {
80 content::WebContents* web_contents = 79 content::WebContents* web_contents =
81 InfoBarService::WebContentsFromInfoBar(infobar()); 80 InfoBarService::WebContentsFromInfoBar(infobar());
82 subresource_filter::ContentSubresourceFilterDriverFactory::FromWebContents( 81 ChromeSubresourceFilterClient::FromWebContents(web_contents)
Bryan McQuade 2017/05/19 13:24:21 just to be sure - the ChromeSubresourceFilterClien
Charlie Harrison 2017/05/19 13:35:00 Yes, they are both scoped to the WebContents.
83 web_contents)
84 ->OnReloadRequested(); 82 ->OnReloadRequested();
85 return true; 83 return true;
86 } 84 }
87 85
88 bool SubresourceFilterInfobarDelegate::LinkClicked( 86 bool SubresourceFilterInfobarDelegate::LinkClicked(
89 WindowOpenDisposition disposition) { 87 WindowOpenDisposition disposition) {
90 ChromeSubresourceFilterClient::LogAction(kActionDetailsShown); 88 ChromeSubresourceFilterClient::LogAction(kActionDetailsShown);
91 return false; 89 return false;
92 } 90 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698