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

Issue 1159033008: Refactor ViewsDelegate singleton (Closed)

Created:
5 years, 6 months ago by mohsen
Modified:
5 years, 6 months ago
Reviewers:
benwells, sadrul, sky
CC:
chromium-reviews, sadrul, yusukes+watch_chromium.org, mlamouri+watch-screen-orientation_chromium.org, shuchen+watch_chromium.org, dcheng, dmazzoni+watch_chromium.org, alicet1, tapted, tdanderson+views_chromium.org, msw+watch_chromium.org, Matt Giuca, aboxhall+watch_chromium.org, jam, nona+watch_chromium.org, je_julie, darin-cc_chromium.org, kalyank, mlamouri+watch-notifications_chromium.org, penghuang+watch_chromium.org, yuzo+watch_chromium.org, chromium-apps-reviews_chromium.org, plundblad+watch_chromium.org, tfarina, nektar+watch_chromium.org, dtseng+watch_chromium.org, peter+watch_chromium.org, James Su
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor ViewsDelegate singleton Currently, the variable containing ViewsDelegate singleton object can be set by anyone and there are cases (at least in tests) where it is freely replaced without properly deleting the old one which can lead to situations where multiple ViewsDelegate objects are in existence. This patch tries to ensure that there is at most one instance available at each time. Also, cleaned up some ViewsDelegate related includes. BUG=492991 Committed: https://crrev.com/0ff8c0e1c8c805bce8e216c74c66ccc8fd137a6f Cr-Commit-Position: refs/heads/master@{#333692}

Patch Set 1 #

Patch Set 2 : . #

Total comments: 10

Patch Set 3 : Addressed review comments #

Total comments: 6

Patch Set 4 : Addressed sky@'s review comments #

Patch Set 5 : Destroy ash ViewsDelegate #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -115 lines) Patch
M apps/ui/views/app_window_frame_view.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ash/content/display/screen_orientation_controller_chromeos_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ash/drag_drop/drag_drop_controller.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ash/drag_drop/drag_drop_controller_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ash/shell/content_client/shell_browser_main_parts.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M ash/shell/content_client/shell_browser_main_parts.cc View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/chrome_browser_main_extra_parts_views.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/find_bar_host_interactive_uitest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/opaque_browser_frame_view.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/menu_test_base.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/base/view_event_test_base.cc View 2 chunks +0 lines, -2 lines 0 comments Download
M ui/app_list/views/app_list_view_unittest.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M ui/message_center/views/message_popup_collection.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/accessibility/native_view_accessibility_auralinux.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/views/bubble/bubble_border_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/cocoa/bridged_native_widget.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M ui/views/controls/menu/menu_model_adapter.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M ui/views/controls/webview/webview.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M ui/views/controls/webview/webview_interactive_uitest.cc View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M ui/views/controls/webview/webview_unittest.cc View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M ui/views/test/test_views_delegate_aura.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/test/test_views_delegate_mac.mm View 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/test/views_test_base.h View 1 2 chunks +4 lines, -3 lines 0 comments Download
M ui/views/test/views_test_base.cc View 2 chunks +3 lines, -1 line 0 comments Download
M ui/views/touchui/touch_selection_menu_runner_views_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/view.cc View 2 chunks +2 lines, -5 lines 0 comments Download
M ui/views/view_unittest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/views_delegate.h View 1 2 3 chunks +7 lines, -5 lines 0 comments Download
M ui/views/views_delegate.cc View 1 2 3 6 chunks +27 lines, -12 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_native_widget_aura_unittest.cc View 1 6 chunks +6 lines, -5 lines 0 comments Download
M ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M ui/views/widget/native_widget_aura.cc View 1 chunk +0 lines, -1 line 0 comments Download
M ui/views/widget/widget.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/views/widget/widget_delegate.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M ui/views/widget/widget_interactive_uitest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M ui/views/win/hwnd_message_handler.cc View 2 chunks +10 lines, -10 lines 0 comments Download
M ui/views/win/windows_session_change_observer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/window/custom_frame_view.cc View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 19 (5 generated)
mohsen
sadrul@: This is my stab at fixing ViewsDelegate situation. What do you think?
5 years, 6 months ago (2015-06-05 21:01:49 UTC) #2
sadrul
LGTM https://codereview.chromium.org/1159033008/diff/20001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1159033008/diff/20001/ui/views/controls/textfield/textfield.cc#newcode290 ui/views/controls/textfield/textfield.cc:290: ->GetDefaultTextfieldObscuredRevealDuration(); Does 'git cl format' do this? https://codereview.chromium.org/1159033008/diff/20001/ui/views/controls/webview/webview_unittest.cc ...
5 years, 6 months ago (2015-06-08 03:27:43 UTC) #3
mohsen
+sky@: for OWNERS in ash/, chrome/browser/ui/, and chrome/test/. https://codereview.chromium.org/1159033008/diff/20001/ui/views/controls/textfield/textfield.cc File ui/views/controls/textfield/textfield.cc (right): https://codereview.chromium.org/1159033008/diff/20001/ui/views/controls/textfield/textfield.cc#newcode290 ui/views/controls/textfield/textfield.cc:290: ->GetDefaultTextfieldObscuredRevealDuration(); ...
5 years, 6 months ago (2015-06-08 19:27:35 UTC) #4
mohsen
+sky@: for OWNERS in ash/, chrome/browser/ui/, and chrome/test/.
5 years, 6 months ago (2015-06-08 19:28:25 UTC) #6
mohsen
+benwells@: for OWNERS in apps/.
5 years, 6 months ago (2015-06-08 19:34:25 UTC) #8
sky
LGTM https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h File ash/shell/content_client/shell_browser_main_parts.h (right): https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h#newcode61 ash/shell/content_client/shell_browser_main_parts.h:61: scoped_ptr<views::ViewsDelegate> views_delegate_; Seems like this should be before ...
5 years, 6 months ago (2015-06-08 20:22:42 UTC) #9
mohsen
https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h File ash/shell/content_client/shell_browser_main_parts.h (right): https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h#newcode61 ash/shell/content_client/shell_browser_main_parts.h:61: scoped_ptr<views::ViewsDelegate> views_delegate_; On 2015/06/08 20:22:42, sky wrote: > Seems ...
5 years, 6 months ago (2015-06-08 20:46:09 UTC) #10
sky
https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h File ash/shell/content_client/shell_browser_main_parts.h (right): https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h#newcode61 ash/shell/content_client/shell_browser_main_parts.h:61: scoped_ptr<views::ViewsDelegate> views_delegate_; On 2015/06/08 20:46:09, mohsen wrote: > On ...
5 years, 6 months ago (2015-06-08 20:48:03 UTC) #11
mohsen
https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h File ash/shell/content_client/shell_browser_main_parts.h (right): https://codereview.chromium.org/1159033008/diff/40001/ash/shell/content_client/shell_browser_main_parts.h#newcode61 ash/shell/content_client/shell_browser_main_parts.h:61: scoped_ptr<views::ViewsDelegate> views_delegate_; On 2015/06/08 20:48:03, sky wrote: > On ...
5 years, 6 months ago (2015-06-09 02:17:23 UTC) #12
sky
LGTM
5 years, 6 months ago (2015-06-09 13:13:52 UTC) #13
benwells
lgtm
5 years, 6 months ago (2015-06-10 04:09:22 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1159033008/80001
5 years, 6 months ago (2015-06-10 04:45:57 UTC) #17
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 6 months ago (2015-06-10 06:49:19 UTC) #18
commit-bot: I haz the power
5 years, 6 months ago (2015-06-10 06:51:02 UTC) #19
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/0ff8c0e1c8c805bce8e216c74c66ccc8fd137a6f
Cr-Commit-Position: refs/heads/master@{#333692}

Powered by Google App Engine
This is Rietveld 408576698