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

Issue 812823002: Remove dependency of infobars component on the embedder (Closed)

Created:
6 years ago by sdefresne
Modified:
6 years ago
CC:
chromium-reviews, droger, Michael van Ouwerkerk, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove dependency of infobars component on the embedder Add a virtual method InfoBarManager::CreateConfirmInfoBar that allow the embedder to use UI specific implementation of ConfirmInfoBar. Port all client code to use this virtual method instead of the static method ConfirmInfoBarDelegate::CreateInfoBar. Implements the InfoBarService::CreateConfirmInfoBar method for the different UI (views, android, cocoa) and for TestInfoBarManager. BUG=386171 TBR=jam@chromium.org TBR=jochen@chromium.org Committed: https://crrev.com/316da458d4d1ea846f078efaf71ae1f23964f42e Cr-Commit-Position: refs/heads/master@{#309437}

Patch Set 1 #

Patch Set 2 : Fix tests by instanciating a TestConfirmInfoBarDelegateFactory #

Total comments: 2

Patch Set 3 : Rename classes and files #

Patch Set 4 : Improves documentation of TestScopedConfirmInfoBarFactory #

Patch Set 5 : Move the virtual method to InfoBarManager #

Patch Set 6 : Fix compilation on android/win #

Total comments: 2

Patch Set 7 : Turn the virtual public and remove the static helper in ConfirmInfoBarDelegate #

Patch Set 8 : Fix android compilation #

Total comments: 11

Patch Set 9 : Address style nits #

Patch Set 10 : Revert visibility changes of overrides #

Patch Set 11 : Fix compilation on Android #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -172 lines) Patch
M athena/main/athena_main.gyp View 1 2 3 4 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/autofill/autofill_cc_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_quota_permission_context.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/custom_handlers/register_protocol_handler_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/devtools/devtools_ui_bindings.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_request_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/cryptotoken_private/cryptotoken_private_api.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/api/debugger/debugger_api.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/messaging/incognito_connectability.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/theme_installed_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/geolocation/geolocation_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/gpu/three_d_api_observer.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/infobars/infobar_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/infobars/infobar_service.cc View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/infobars/insecure_content_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/infobars/simple_alert_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/media/media_stream_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media/midi_permission_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media/protected_media_identifier_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/nacl_host/nacl_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h View 1 2 3 4 7 8 9 10 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/notifications/desktop_notification_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/password_manager/save_password_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/pepper_broker_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/plugins/plugin_infobar_delegates.cc View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -11 lines 0 comments Download
M chrome/browser/plugins/plugin_observer.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ssl/ssl_add_certificate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/supervised_user/supervised_user_navigation_observer.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/android/infobars/confirm_infobar.cc View 1 2 3 4 1 chunk +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/auto_login_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/keystone_infobar_delegate.mm View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/collected_cookies_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/extensions/extension_install_ui_default.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/hung_plugin_tab_helper.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/startup/autolaunch_prompt_win.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/startup/default_browser_prompt.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/startup/google_api_keys_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/startup/session_crashed_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/infobars/confirm_infobar.cc View 1 2 3 4 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/website_settings/website_settings_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -2 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -3 lines 0 comments Download
M components/google/core/browser/BUILD.gn View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M components/google/core/browser/DEPS View 1 1 chunk +1 line, -0 lines 0 comments Download
M components/google/core/browser/google_url_tracker_infobar_delegate.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M components/google/core/browser/google_url_tracker_unittest.cc View 1 2 3 4 3 chunks +10 lines, -0 lines 0 comments Download
M components/infobars.gypi View 1 2 3 4 1 chunk +0 lines, -16 lines 0 comments Download
M components/infobars/core/confirm_infobar_delegate.h View 1 2 3 4 5 6 2 chunks +2 lines, -4 lines 0 comments Download
M components/infobars/core/confirm_infobar_delegate.cc View 1 2 3 4 5 6 2 chunks +2 lines, -3 lines 0 comments Download
M components/infobars/core/infobar_manager.h View 1 2 3 4 5 6 2 chunks +6 lines, -0 lines 0 comments Download
M components/infobars/test/BUILD.gn View 1 2 3 4 1 chunk +0 lines, -17 lines 0 comments Download
D components/infobars/test/infobar_test.cc View 1 chunk +0 lines, -21 lines 0 comments Download
D ios/chrome/browser/infobars/confirm_infobar_delegate.mm View 1 2 3 4 5 6 1 chunk +0 lines, -21 lines 0 comments Download
M ios/chrome/ios_chrome.gyp View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 20 (5 generated)
sdefresne
pkasting: could you please review this CL. It introduce an abstract singleton used to implement ...
6 years ago (2014-12-17 19:10:45 UTC) #2
Michael van Ouwerkerk
https://codereview.chromium.org/812823002/diff/20001/chrome/browser/geolocation/geolocation_permission_context_unittest.cc File chrome/browser/geolocation/geolocation_permission_context_unittest.cc (right): https://codereview.chromium.org/812823002/diff/20001/chrome/browser/geolocation/geolocation_permission_context_unittest.cc#newcode140 chrome/browser/geolocation/geolocation_permission_context_unittest.cc:140: TestConfirmInfoBarDelegateFactory confirm_info_bar_delegate_factory_; Why is this needed? It appears to ...
6 years ago (2014-12-17 19:23:44 UTC) #4
Peter Kasting
Can we implement this on some class that already exists? I'm not terribly thrilled about ...
6 years ago (2014-12-17 19:32:50 UTC) #5
sdefresne
On 2014/12/17 at 19:32:50, pkasting wrote: > Can we implement this on some class that ...
6 years ago (2014-12-18 14:34:00 UTC) #6
sdefresne
mvanouwerkerk: FYI https://codereview.chromium.org/812823002/diff/20001/chrome/browser/geolocation/geolocation_permission_context_unittest.cc File chrome/browser/geolocation/geolocation_permission_context_unittest.cc (right): https://codereview.chromium.org/812823002/diff/20001/chrome/browser/geolocation/geolocation_permission_context_unittest.cc#newcode140 chrome/browser/geolocation/geolocation_permission_context_unittest.cc:140: TestConfirmInfoBarDelegateFactory confirm_info_bar_delegate_factory_; On 2014/12/17 at 19:23:43, Michael ...
6 years ago (2014-12-18 14:48:59 UTC) #8
Peter Kasting
OK, this is definitely better. I didn't think through how ConfirmInfoBarDelegate::CreateInfoBar() would need to have ...
6 years ago (2014-12-18 19:23:02 UTC) #9
sdefresne
Please take another look. https://codereview.chromium.org/812823002/diff/100001/components/infobars/core/infobar_manager.h File components/infobars/core/infobar_manager.h (right): https://codereview.chromium.org/812823002/diff/100001/components/infobars/core/infobar_manager.h#newcode121 components/infobars/core/infobar_manager.h:121: // of ConfirmInfoBar. On 2014/12/18 ...
6 years ago (2014-12-19 11:06:15 UTC) #10
Peter Kasting
LGTM modulo style https://codereview.chromium.org/812823002/diff/140001/chrome/browser/infobars/infobar_service.h File chrome/browser/infobars/infobar_service.h (right): https://codereview.chromium.org/812823002/diff/140001/chrome/browser/infobars/infobar_service.h#newcode48 chrome/browser/infobars/infobar_service.h:48: // InfoBarManager: Why make these public ...
6 years ago (2014-12-19 23:06:23 UTC) #11
sdefresne
Will TBR OWNERS since this is just mechanical change in the client code. jam: OWNERS ...
6 years ago (2014-12-20 11:30:55 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/812823002/200001
6 years ago (2014-12-22 17:12:10 UTC) #15
commit-bot: I haz the power
Committed patchset #11 (id:200001)
6 years ago (2014-12-22 17:31:38 UTC) #16
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/316da458d4d1ea846f078efaf71ae1f23964f42e Cr-Commit-Position: refs/heads/master@{#309437}
6 years ago (2014-12-22 17:32:24 UTC) #17
Peter Kasting
https://codereview.chromium.org/812823002/diff/140001/chrome/browser/infobars/infobar_service.h File chrome/browser/infobars/infobar_service.h (right): https://codereview.chromium.org/812823002/diff/140001/chrome/browser/infobars/infobar_service.h#newcode48 chrome/browser/infobars/infobar_service.h:48: // InfoBarManager: On 2014/12/20 11:30:55, sdefresne wrote: > On ...
6 years ago (2014-12-22 19:22:06 UTC) #18
sdefresne
https://codereview.chromium.org/812823002/diff/140001/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h File chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h (right): https://codereview.chromium.org/812823002/diff/140001/chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h#newcode19 chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h:19: } On 2014/12/22 at 19:22:05, Peter Kasting wrote: > ...
6 years ago (2014-12-22 20:48:41 UTC) #19
Peter Kasting
6 years ago (2014-12-22 21:24:11 UTC) #20
Message was sent while issue was closed.
On 2014/12/22 20:48:41, sdefresne wrote:
>
https://codereview.chromium.org/812823002/diff/140001/chrome/browser/net/spdy...
> File chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h
> (right):
> 
>
https://codereview.chromium.org/812823002/diff/140001/chrome/browser/net/spdy...
> chrome/browser/net/spdyproxy/data_reduction_proxy_infobar_delegate.h:19: }
> On 2014/12/22 at 19:22:05, Peter Kasting wrote:
> > On 2014/12/20 11:30:55, sdefresne wrote:
> > > On 2014/12/19 at 23:06:23, Peter Kasting wrote:
> > > > This forward-decl doesn't seem to be needed?
> > > 
> > > It is in fact required to allow Android code to provide a system specific
> > > implementation of DataReductionProxyInfoBarDelegate::CreateInfoBar().
> > 
> > I don't understand why the forward-decl is needed in this file, though. 
Isn't
> it sufficient to declare or define this type in the file that declares/defines
> this CreateInfoBar() override?
> > 
> > Basically, I'm just saying that this type is never referred to in this
> specific .h, so presumably it could be defined in whatever file #includes this
> header and needs it.
> 
> Sorry, I was again unclear. I planned to remove this, but then I found that
> compilation failed on Android. This is because the class define a static
method
> CreateInfoBar() that is overridden in
> chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc. In a later
> patch for this CL, I did have to re-introduce this forward-declaration as I
> changed the declaration of CreateInfoBar() to take both an
> infobars::InfoBarManager* and a scoped_ptr<DataReductionProxyInfoBarDelegate>.
> 
> See patchset 11 where the declaration of CreateInfoBar is slightly different
and
> uses infobars::InfoBarManager.

Ah, that looks more reasonable.

Powered by Google App Engine
This is Rietveld 408576698