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

Issue 2907983002: Allow dialogs to use a custom View as their title. (Closed)

Created:
3 years, 6 months ago by Bret
Modified:
3 years, 5 months ago
Reviewers:
Peter Kasting, sky
CC:
chromium-reviews, groby+bubble_chromium.org, vabr+watchlistpasswordmanager_chromium.org, tfarina, hcarmona+bubble_chromium.org, gcasto+watchlist_chromium.org, rouslan+bubble_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow dialogs to use a custom View as their title. Added a method to DialogDelegate that lets a dialog subclass specify a View that will be used as the dialog's title. As an example, changed the Save Password dialog and removed its ad-hoc title. Also removed SetTitleFontList, as it's not clear how it should interact with a generic View title, and updated the subclasses that were using it. BUG=654115, 702196 Review-Url: https://codereview.chromium.org/2907983002 Cr-Commit-Position: refs/heads/master@{#482840} Committed: https://chromium.googlesource.com/chromium/src/+/257ee88f3a0e1b02da7814cbc37f693494bad6d3

Patch Set 1 #

Patch Set 2 : finished? #

Patch Set 3 : change to dialog delegate #

Patch Set 4 : do the easier thing #

Patch Set 5 : minor edits #

Patch Set 6 : merge #

Total comments: 8

Patch Set 7 : WIP: second iteration #

Total comments: 17

Patch Set 8 : second iteration #

Patch Set 9 : minor edits #

Patch Set 10 : pass strings by reference #

Total comments: 27

Patch Set 11 : addressed comments #

Patch Set 12 : comments 2 #

Total comments: 10

Patch Set 13 : comments 3 #

Total comments: 8

Patch Set 14 : comments 4 #

Total comments: 6

Patch Set 15 : comments 5 #

Patch Set 16 : merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -150 lines) Patch
M chrome/browser/ui/views/page_info/page_info_bubble_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/page_info/page_info_bubble_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +12 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +12 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 14 chunks +30 lines, -67 lines 0 comments Download
M chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +9 lines, -7 lines 0 comments Download
M ui/views/bubble/bubble_dialog_delegate.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +0 lines, -5 lines 0 comments Download
M ui/views/bubble/bubble_dialog_delegate.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +0 lines, -10 lines 0 comments Download
M ui/views/bubble/bubble_dialog_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +53 lines, -2 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +25 lines, -10 lines 0 comments Download
M ui/views/bubble/bubble_frame_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +56 lines, -38 lines 0 comments Download
M ui/views/window/dialog_delegate_unittest.cc View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download

Messages

Total messages: 54 (26 generated)
Bret
pkasting@: general review sky@: approach and OWNERS PTAL!
3 years, 6 months ago (2017-06-06 22:12:29 UTC) #14
sky
https://codereview.chromium.org/2907983002/diff/100001/ui/views/window/dialog_delegate.h File ui/views/window/dialog_delegate.h (right): https://codereview.chromium.org/2907983002/diff/100001/ui/views/window/dialog_delegate.h#newcode54 ui/views/window/dialog_delegate.h:54: virtual StyledLabel* CreateTitleView(); One concern I have with adding ...
3 years, 6 months ago (2017-06-06 23:55:10 UTC) #15
Bret
https://codereview.chromium.org/2907983002/diff/100001/ui/views/window/dialog_delegate.h File ui/views/window/dialog_delegate.h (right): https://codereview.chromium.org/2907983002/diff/100001/ui/views/window/dialog_delegate.h#newcode54 ui/views/window/dialog_delegate.h:54: virtual StyledLabel* CreateTitleView(); On 2017/06/06 23:55:10, sky wrote: > ...
3 years, 6 months ago (2017-06-07 00:37:46 UTC) #16
Peter Kasting
https://codereview.chromium.org/2907983002/diff/100001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/100001/ui/views/bubble/bubble_frame_view.cc#newcode238 ui/views/bubble/bubble_frame_view.cc:238: return; Why decide not to add the title at ...
3 years, 6 months ago (2017-06-07 02:40:43 UTC) #17
sky
https://codereview.chromium.org/2907983002/diff/100001/ui/views/window/dialog_delegate.h File ui/views/window/dialog_delegate.h (right): https://codereview.chromium.org/2907983002/diff/100001/ui/views/window/dialog_delegate.h#newcode54 ui/views/window/dialog_delegate.h:54: virtual StyledLabel* CreateTitleView(); On 2017/06/07 00:37:46, Bret wrote: > ...
3 years, 6 months ago (2017-06-07 15:59:40 UTC) #18
Bret
I think I have enough information to do another iteration of this. Thanks for the ...
3 years, 6 months ago (2017-06-07 20:15:42 UTC) #19
sky
On Wed, Jun 7, 2017 at 1:15 PM, <bsep@chromium.org> wrote: > I think I have ...
3 years, 6 months ago (2017-06-07 23:02:47 UTC) #20
sky
https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_dialog_delegate.h File ui/views/bubble/bubble_dialog_delegate.h (right): https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_dialog_delegate.h#newcode61 ui/views/bubble/bubble_dialog_delegate.h:61: void AddedToWidget() override; Move up to WidgetDelegateView section above. ...
3 years, 6 months ago (2017-06-09 23:49:16 UTC) #21
Bret
Just responding, no new patchset. https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc#newcode242 ui/views/bubble/bubble_frame_view.cc:242: bubble_delegate->PropagateUpdateTitleView(delegate_title_); On 2017/06/09 23:49:16, ...
3 years, 6 months ago (2017-06-10 00:52:01 UTC) #22
Bret
This is ready for review again. https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_dialog_delegate.h File ui/views/bubble/bubble_dialog_delegate.h (right): https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_dialog_delegate.h#newcode61 ui/views/bubble/bubble_dialog_delegate.h:61: void AddedToWidget() override; ...
3 years, 6 months ago (2017-06-15 22:20:35 UTC) #23
Peter Kasting
This seems like a safer design than before. https://codereview.chromium.org/2907983002/diff/180001/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc File chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc (right): https://codereview.chromium.org/2907983002/diff/180001/chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc#newcode820 chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc:820: DCHECK_EQ(range, ...
3 years, 6 months ago (2017-06-17 01:16:21 UTC) #26
sky
https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc#newcode242 ui/views/bubble/bubble_frame_view.cc:242: bubble_delegate->PropagateUpdateTitleView(delegate_title_); On 2017/06/10 00:52:01, Bret wrote: > On 2017/06/09 ...
3 years, 6 months ago (2017-06-19 15:19:25 UTC) #27
Bret
New patchset is quite a bit different. https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc#newcode242 ui/views/bubble/bubble_frame_view.cc:242: bubble_delegate->PropagateUpdateTitleView(delegate_title_); On ...
3 years, 6 months ago (2017-06-21 22:37:55 UTC) #30
Peter Kasting
https://codereview.chromium.org/2907983002/diff/180001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/180001/ui/views/bubble/bubble_frame_view.cc#newcode254 ui/views/bubble/bubble_frame_view.cc:254: if (default_title_) { On 2017/06/21 22:37:54, Bret wrote: > ...
3 years, 6 months ago (2017-06-21 23:45:22 UTC) #33
Bret
https://codereview.chromium.org/2907983002/diff/180001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/180001/ui/views/bubble/bubble_frame_view.cc#newcode254 ui/views/bubble/bubble_frame_view.cc:254: if (default_title_) { On 2017/06/21 23:45:22, Peter Kasting wrote: ...
3 years, 6 months ago (2017-06-22 01:38:57 UTC) #34
sky
This is much improved! Thanks! https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/120001/ui/views/bubble/bubble_frame_view.cc#newcode242 ui/views/bubble/bubble_frame_view.cc:242: bubble_delegate->PropagateUpdateTitleView(delegate_title_); On 2017/06/21 22:37:54, ...
3 years, 6 months ago (2017-06-22 14:48:48 UTC) #35
Peter Kasting
https://codereview.chromium.org/2907983002/diff/220001/ui/views/bubble/bubble_frame_view.h File ui/views/bubble/bubble_frame_view.h (right): https://codereview.chromium.org/2907983002/diff/220001/ui/views/bubble/bubble_frame_view.h#newcode110 ui/views/bubble/bubble_frame_view.h:110: static_cast<const BubbleFrameView*>(this)->title()); On 2017/06/22 14:48:48, sky wrote: > static_cast ...
3 years, 6 months ago (2017-06-22 17:49:35 UTC) #36
sky
Thanks for pointing that out! I hadn't realized static_cast is fine in this situation. -Scott ...
3 years, 6 months ago (2017-06-22 20:16:24 UTC) #37
Bret
https://codereview.chromium.org/2907983002/diff/180001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/180001/ui/views/bubble/bubble_frame_view.cc#newcode342 ui/views/bubble/bubble_frame_view.cc:342: title_label_right = close_->x(); On 2017/06/22 01:38:57, Bret wrote: > ...
3 years, 6 months ago (2017-06-22 22:18:30 UTC) #38
sky
custom_title_ is perfect. LGTM!
3 years, 6 months ago (2017-06-23 03:19:01 UTC) #39
Peter Kasting
LGTM https://codereview.chromium.org/2907983002/diff/240001/chrome/browser/ui/views/page_info/page_info_bubble_view.cc File chrome/browser/ui/views/page_info/page_info_bubble_view.cc (right): https://codereview.chromium.org/2907983002/diff/240001/chrome/browser/ui/views/page_info/page_info_bubble_view.cc#newcode545 chrome/browser/ui/views/page_info/page_info_bubble_view.cc:545: GetBubbleFrameView()->SetTitleView(title_); SetTitleView() basically "takes ownership" of this object ...
3 years, 6 months ago (2017-06-23 06:00:09 UTC) #40
Bret
https://codereview.chromium.org/2907983002/diff/240001/chrome/browser/ui/views/page_info/page_info_bubble_view.cc File chrome/browser/ui/views/page_info/page_info_bubble_view.cc (right): https://codereview.chromium.org/2907983002/diff/240001/chrome/browser/ui/views/page_info/page_info_bubble_view.cc#newcode545 chrome/browser/ui/views/page_info/page_info_bubble_view.cc:545: GetBubbleFrameView()->SetTitleView(title_); On 2017/06/23 06:00:09, Peter Kasting wrote: > SetTitleView() ...
3 years, 5 months ago (2017-06-24 01:12:33 UTC) #41
Peter Kasting
You're right, either way is scary and could break. I kinda like the scary casting ...
3 years, 5 months ago (2017-06-27 01:13:18 UTC) #42
Bret
https://codereview.chromium.org/2907983002/diff/260001/ui/views/bubble/bubble_frame_view.cc File ui/views/bubble/bubble_frame_view.cc (right): https://codereview.chromium.org/2907983002/diff/260001/ui/views/bubble/bubble_frame_view.cc#newcode257 ui/views/bubble/bubble_frame_view.cc:257: custom_title_ = title_view.release(); On 2017/06/27 01:13:17, Peter Kasting wrote: ...
3 years, 5 months ago (2017-06-27 23:21:42 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2907983002/280001
3 years, 5 months ago (2017-06-27 23:22:19 UTC) #46
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/247059) ios-simulator-xcode-clang on master.tryserver.chromium.mac (JOB_FAILED, ...
3 years, 5 months ago (2017-06-27 23:24:47 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2907983002/300001
3 years, 5 months ago (2017-06-28 00:07:33 UTC) #51
commit-bot: I haz the power
3 years, 5 months ago (2017-06-28 01:20:20 UTC) #54
Message was sent while issue was closed.
Committed patchset #16 (id:300001) as
https://chromium.googlesource.com/chromium/src/+/257ee88f3a0e1b02da7814cbc37f...

Powered by Google App Engine
This is Rietveld 408576698