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

Issue 595213005: Eliminate chrome::IsTrustedWindowWithScheme (Closed)

Created:
6 years, 2 months ago by stevenjb
Modified:
6 years, 2 months ago
CC:
chromium-reviews, kalyank, sadrul, ben+ash_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Eliminate chrome::IsTrustedWindowWithScheme In hindsight, attempting to generalize the settings window behavior was a mistake. This should be simpler and more maintainable. BUG=417633

Patch Set 1 #

Patch Set 2 : . #

Total comments: 6

Patch Set 3 : Feedback #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -32 lines) Patch
M chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc View 1 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/chrome_pages.h View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/chrome_pages.cc View 1 chunk +0 lines, -14 lines 0 comments Download
M chrome/browser/ui/settings_window_manager.h View 3 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/settings_window_manager.cc View 1 2 2 chunks +17 lines, -9 lines 1 comment Download

Messages

Total messages: 9 (1 generated)
stevenjb
6 years, 2 months ago (2014-09-25 20:14:05 UTC) #2
Mr4D (OOO till 08-26)
Please see comments. lgtm. https://codereview.chromium.org/595213005/diff/20001/chrome/browser/ui/settings_window_manager.cc File chrome/browser/ui/settings_window_manager.cc (right): https://codereview.chromium.org/595213005/diff/20001/chrome/browser/ui/settings_window_manager.cc#newcode68 chrome/browser/ui/settings_window_manager.cc:68: observers_, OnNewSettingsWindow(navigate_params_->browser)); At this time ...
6 years, 2 months ago (2014-09-25 21:18:34 UTC) #3
stevenjb
https://codereview.chromium.org/595213005/diff/20001/chrome/browser/ui/settings_window_manager.cc File chrome/browser/ui/settings_window_manager.cc (right): https://codereview.chromium.org/595213005/diff/20001/chrome/browser/ui/settings_window_manager.cc#newcode68 chrome/browser/ui/settings_window_manager.cc:68: observers_, OnNewSettingsWindow(navigate_params_->browser)); On 2014/09/25 21:18:34, Mr4D wrote: > At ...
6 years, 2 months ago (2014-09-25 21:36:58 UTC) #4
sky
https://codereview.chromium.org/595213005/diff/40001/chrome/browser/ui/settings_window_manager.cc File chrome/browser/ui/settings_window_manager.cc (right): https://codereview.chromium.org/595213005/diff/40001/chrome/browser/ui/settings_window_manager.cc#newcode84 chrome/browser/ui/settings_window_manager.cc:84: if (navigate_params_ && navigate_params_->browser == browser) Dependencies like this ...
6 years, 2 months ago (2014-09-25 23:36:52 UTC) #5
stevenjb
On 2014/09/25 23:36:52, sky wrote: > https://codereview.chromium.org/595213005/diff/40001/chrome/browser/ui/settings_window_manager.cc > File chrome/browser/ui/settings_window_manager.cc (right): > > https://codereview.chromium.org/595213005/diff/40001/chrome/browser/ui/settings_window_manager.cc#newcode84 > ...
6 years, 2 months ago (2014-09-26 16:39:41 UTC) #6
sky
What I dislike is having to maintain state assuming that IsSettingsBrowser is going to be ...
6 years, 2 months ago (2014-09-26 19:44:48 UTC) #7
stevenjb
I don't think that SettingsWindowManager should need to know who "whoever needs it" might be, ...
6 years, 2 months ago (2014-09-26 20:15:01 UTC) #8
sky
6 years, 2 months ago (2014-09-26 22:30:46 UTC) #9
I'm not too fond of adding something to browser, but this sure does
feel like a BrowserType. Can we pass something through the create
params?

On Fri, Sep 26, 2014 at 1:15 PM, Steven Bennetts <stevenjb@chromium.org> wrote:
> I don't think that SettingsWindowManager should need to know who "whoever
> needs it" might be, Currently that is BrowserShortcutLauncherItemController
> and Browser.
>
> As I see it, our options are:
> a) Use this workaround or something similar to allow SettingsWindowManager
> to identify Settings browsers during chrome::Navigate.
> b) Decorate Browser so that we do not need
> SettingsWindowManager::IsSettingsWindow at all.
>
> We were using chrome::IsTrustedPopupWindowWithScheme(browser,
> content::kChromeUIScheme) to implement (b), but that is not reliable if the
> Browser navigates away from a chrome:: page (and frankly was not a very good
> way to do this in the first place).
>
> I am not entirely against adding is_settings_window() to Browser, but I'm
> not super enthusiastic about that either.
>
> In the long (medium, maybe even short) run, I am hoping to make Settings a
> WebUI and not a Browser at all, which will allow us to eliminate this hack
> entirely.
>
>
> On Fri, Sep 26, 2014 at 1:44 PM, Scott Violet <sky@chromium.org> wrote:
>>
>> What I dislike is having to maintain state assuming that
>> IsSettingsBrowser is going to be invoked. This makes for awkward
>> members in SettingsWindowManager. Can't that state be passed into
>> whoever needs it?
>>
>> On Fri, Sep 26, 2014 at 9:39 AM,  <stevenjb@chromium.org> wrote:
>> > On 2014/09/25 23:36:52, sky wrote:
>> >
>> >
>> >
https://codereview.chromium.org/595213005/diff/40001/chrome/browser/ui/settin...
>> >>
>> >> File chrome/browser/ui/settings_window_manager.cc (right):
>> >
>> >
>> >
>> >
>> >
https://codereview.chromium.org/595213005/diff/40001/chrome/browser/ui/settin...
>> >>
>> >> chrome/browser/ui/settings_window_manager.cc:84: if (navigate_params_
>> >> &&
>> >> navigate_params_->browser == browser)
>> >> Dependencies like this are fragile and result in NavigateParams needing
>> >> to
>> >
>> > talk
>> >>
>> >> to more things. I would rather you add something to NavigateParams that
>> >> explicitly tells it the browser is a settings browser.
>> >
>> >
>> > I'm not sure that I follow your suggestion. We rely on
>> > NavigateParams->browser
>> > for the Navigate() result, so it does not feel like we are adding any
>> > dependencies here to the SettingsWindow code. Tacking on an extra
>> > parameter
>> > to
>> > NavigateParams just for this seems like adding an unnecessary dependency
>> > to
>> > NavigateParams. Or are you suggesting that the Browser should know that
>> > it
>> > is a
>> > settings browser and we should use something like
>> > browser->IsSettingsBrowser()
>> > instead? I was trying to avoid tacking on yet another Browser property.
>> >
>> >
>> >
>> > https://codereview.chromium.org/595213005/
>
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698