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

Issue 543663002: Componentize sad_tab (Closed)

Created:
6 years, 3 months ago by hashimoto
Modified:
6 years, 1 month ago
Reviewers:
msw, sadrul, blundell
CC:
chromium-reviews, tfarina, jshin+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Componentize sad_tab Add a new component components/sad_tab. Move sad_tab_types.h, sad_tab.{cc,h}, sad_tab_helper.{cc,h}, sad_tab_view.{cc,h} to components/sad_tab. Move URL constants to components/sad_tab/url_constants.{cc,h}. Move string resources to components/sad_tab_strings.grdp Add SadTabClient and implement ChromeSadTabClient. Fix tab_helpers.cc to pass ChromeSadTabClient to SadTabHelper. Copy chrome/browser/ui/OWNERS to components/sad_tab. Fix DEPS, GYP and GN. BUG=402485 TEST=Open chrome://crash and chrome://kill

Patch Set 1 : #

Total comments: 8

Patch Set 2 : rebase #

Patch Set 3 : Address comments #

Patch Set 4 : Move images #

Patch Set 5 : rebase #

Patch Set 6 : Fix GN #

Total comments: 5

Patch Set 7 : rebase #

Patch Set 8 : Move cocoa stuff to components/sad_tab #

Patch Set 9 : Fix url_constants.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+487 lines, -1220 lines) Patch
M chrome/app/generated_resources.grd View 1 chunk +0 lines, -34 lines 0 comments Download
D chrome/app/theme/default_100_percent/common/killtab.png View 1 2 3 Binary file 0 comments Download
D chrome/app/theme/default_100_percent/common/sadtab.png View 1 2 3 Binary file 0 comments Download
D chrome/app/theme/default_200_percent/common/sadtab.png View 1 2 3 Binary file 0 comments Download
M chrome/app/theme/theme_resources.grd View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/resources/crashes.css View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/BUILD.gn View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/DEPS View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/bookmarks/bookmark_tab_helper.cc View 2 chunks +2 lines, -2 lines 0 comments Download
A chrome/browser/ui/chrome_sad_tab_client.h View 1 2 3 4 5 6 7 1 chunk +24 lines, -0 lines 0 comments Download
A chrome/browser/ui/chrome_sad_tab_client.cc View 1 2 3 4 5 6 7 1 chunk +29 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -58 lines 0 comments Download
M chrome/browser/ui/cocoa/tab_contents/sad_tab_controller.mm View 1 2 3 4 5 6 7 1 chunk +0 lines, -72 lines 0 comments Download
D chrome/browser/ui/cocoa/tab_contents/sad_tab_controller_unittest.mm View 1 2 3 4 5 6 7 1 chunk +0 lines, -113 lines 0 comments Download
D chrome/browser/ui/cocoa/tab_contents/sad_tab_view.h View 1 2 3 4 5 6 7 1 chunk +0 lines, -41 lines 0 comments Download
M chrome/browser/ui/cocoa/tab_contents/sad_tab_view.mm View 1 2 3 4 5 6 7 1 chunk +0 lines, -201 lines 0 comments Download
D chrome/browser/ui/cocoa/tab_contents/sad_tab_view_unittest.mm View 1 2 3 4 5 6 7 1 chunk +0 lines, -25 lines 0 comments Download
D chrome/browser/ui/sad_tab.h View 1 chunk +0 lines, -37 lines 0 comments Download
D chrome/browser/ui/sad_tab.cc View 1 chunk +0 lines, -16 lines 0 comments Download
D chrome/browser/ui/sad_tab_helper.h View 1 chunk +0 lines, -42 lines 0 comments Download
D chrome/browser/ui/sad_tab_helper.cc View 1 chunk +0 lines, -48 lines 0 comments Download
D chrome/browser/ui/sad_tab_types.h View 1 chunk +0 lines, -19 lines 0 comments Download
M chrome/browser/ui/tab_helpers.cc View 1 2 3 4 2 chunks +4 lines, -2 lines 0 comments Download
D chrome/browser/ui/views/sad_tab_view.h View 1 chunk +0 lines, -73 lines 0 comments Download
D chrome/browser/ui/views/sad_tab_view.cc View 1 2 3 4 1 chunk +0 lines, -283 lines 0 comments Download
M chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc View 1 2 3 4 5 6 3 chunks +10 lines, -6 lines 0 comments Download
M chrome/browser/ui/zoom/zoom_controller.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 2 3 4 5 6 7 5 chunks +5 lines, -11 lines 0 comments Download
M chrome/chrome_nibs.gyp View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 2 chunks +1 line, -2 lines 0 comments Download
M chrome/common/url_constants.h View 1 2 3 4 5 6 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/common/url_constants.cc View 1 2 3 4 5 6 1 chunk +0 lines, -14 lines 0 comments Download
M components/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/OWNERS View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M components/components.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/components_strings.grd View 1 chunk +1 line, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M components/resources/components_scaled_resources.grd View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A + components/resources/default_100_percent/common/sad_tab/killtab.png View 1 2 3 Binary file 0 comments Download
A + components/resources/default_100_percent/common/sad_tab/sadtab.png View 1 2 3 Binary file 0 comments Download
A + components/resources/default_200_percent/common/sad_tab/sadtab.png View 1 2 3 Binary file 0 comments Download
A components/resources/sad_tab_scaled_resources.grdp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
A components/sad_tab.gypi View 1 2 3 4 5 6 7 1 chunk +58 lines, -0 lines 0 comments Download
A components/sad_tab/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +62 lines, -0 lines 0 comments Download
A + components/sad_tab/DEPS View 1 2 3 4 5 6 1 chunk +4 lines, -6 lines 0 comments Download
A + components/sad_tab/OWNERS View 0 chunks +-1 lines, --1 lines 0 comments Download
A components/sad_tab/cocoa/DEPS View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
A + components/sad_tab/cocoa/sad_tab_controller.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -6 lines 0 comments Download
A + components/sad_tab/cocoa/sad_tab_controller.mm View 1 2 3 4 5 6 7 2 chunks +7 lines, -5 lines 0 comments Download
A + components/sad_tab/cocoa/sad_tab_controller_unittest.mm View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
A + components/sad_tab/cocoa/sad_tab_view.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
A + components/sad_tab/cocoa/sad_tab_view.mm View 1 2 3 4 5 6 7 1 chunk +4 lines, -5 lines 0 comments Download
A + components/sad_tab/cocoa/sad_tab_view_unittest.mm View 1 2 3 4 5 6 7 1 chunk +3 lines, -3 lines 0 comments Download
A + components/sad_tab/sad_tab.h View 2 chunks +11 lines, -7 lines 0 comments Download
A + components/sad_tab/sad_tab.cc View 2 chunks +3 lines, -3 lines 0 comments Download
A components/sad_tab/sad_tab_client.h View 1 2 3 4 5 6 7 1 chunk +36 lines, -0 lines 0 comments Download
A + components/sad_tab/sad_tab_helper.h View 3 chunks +17 lines, -8 lines 0 comments Download
A + components/sad_tab/sad_tab_helper.cc View 2 3 4 5 6 7 2 chunks +27 lines, -14 lines 0 comments Download
A + components/sad_tab/sad_tab_types.h View 2 chunks +5 lines, -5 lines 0 comments Download
A components/sad_tab/url_constants.h View 1 chunk +18 lines, -0 lines 0 comments Download
A components/sad_tab/url_constants.cc View 1 2 3 4 5 6 7 8 1 chunk +21 lines, -0 lines 0 comments Download
A + components/sad_tab/views/DEPS View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
A + components/sad_tab/views/sad_tab_view.h View 6 chunks +15 lines, -8 lines 0 comments Download
A + components/sad_tab/views/sad_tab_view.cc View 1 2 3 4 5 6 7 11 chunks +28 lines, -28 lines 0 comments Download
A components/sad_tab_strings.grdp View 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (19 generated)
hashimoto
Could you review this?
6 years, 3 months ago (2014-09-04 11:13:29 UTC) #11
hashimoto
+blundell@ as an owner of components.
6 years, 3 months ago (2014-09-04 11:14:58 UTC) #13
blundell
Looks good, just one main concern. You'll have to do the internal CL adding sad_tabs.grdp. ...
6 years, 3 months ago (2014-09-05 09:08:53 UTC) #14
hashimoto
https://codereview.chromium.org/543663002/diff/170001/chrome/browser/ui/chrome_sad_tab_client.cc File chrome/browser/ui/chrome_sad_tab_client.cc (right): https://codereview.chromium.org/543663002/diff/170001/chrome/browser/ui/chrome_sad_tab_client.cc#newcode34 chrome/browser/ui/chrome_sad_tab_client.cc:34: return ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( On 2014/09/05 09:08:53, blundell wrote: > Why ...
6 years, 3 months ago (2014-09-08 12:14:50 UTC) #18
blundell
lgtm
6 years, 3 months ago (2014-09-08 12:22:26 UTC) #19
Peter Kasting
I don't know anything about sad_tab. I shouldn't be in the OWNERS list for it. ...
6 years, 3 months ago (2014-09-08 17:47:18 UTC) #21
hashimoto
msw@, could you take a look at this change? On 2014/09/08 17:47:18, Peter Kasting wrote: ...
6 years, 3 months ago (2014-09-11 07:53:38 UTC) #22
msw
Sadrul would be a better reviewer. I agree with Peter that copying over c/b/ui/OWNERS might ...
6 years, 3 months ago (2014-09-15 18:14:54 UTC) #24
hashimoto
sadrul@, could you take a look at this change?
6 years, 3 months ago (2014-09-22 04:31:20 UTC) #25
sadrul
https://codereview.chromium.org/543663002/diff/330001/components/sad_tab/sad_tab.h File components/sad_tab/sad_tab.h (right): https://codereview.chromium.org/543663002/diff/330001/components/sad_tab/sad_tab.h#newcode26 components/sad_tab/sad_tab.h:26: This doesn't seem to exist/be necessary in this patchset, ...
6 years, 3 months ago (2014-09-22 16:48:22 UTC) #26
hashimoto
OK, let's move SadTabCocoa too then. Made a patch to prepare for the move. (https://codereview.chromium.org/595283002/)
6 years, 3 months ago (2014-09-24 09:56:25 UTC) #27
hashimoto
6 years, 2 months ago (2014-09-26 08:43:36 UTC) #31
Sorry for this patch being this large.
Maybe I should start with a smaller patch like just moving resources to
components?

https://codereview.chromium.org/543663002/diff/330001/components/sad_tab/sad_...
File components/sad_tab/sad_tab_helper.cc (right):

https://codereview.chromium.org/543663002/diff/330001/components/sad_tab/sad_...
components/sad_tab/sad_tab_helper.cc:57: sad_tab_ =
client_->CreateSadTab(web_contents(), kind);
On 2014/09/22 16:48:22, sadrul wrote:
> My suggestion would be to: (1) move SadTabCocoa inside
> //components/sad_tab/cocoa/, (2) remove Client::CreateSadTab, (3) have
> SadTab::Create() create the views/cocoa version as appropriate. This way, the
> app (i.e. chrome, athena) only needs to create the SadTabHelper, and provide
the
> implementations of IsInBrowserShutdown() and ShowFeedbackPage(), instead of
also
> having to know about the internal implementations of SadTabViews, or provide
an
> implementation of it (as this patch does with SadTabCocoa). This way, we also
> don't need extra code for ChromeSadTabClient on mac.

Done.

https://codereview.chromium.org/543663002/diff/330001/components/sad_tab/url_...
File components/sad_tab/url_constants.cc (right):

https://codereview.chromium.org/543663002/diff/330001/components/sad_tab/url_...
components/sad_tab/url_constants.cc:22: 
On 2014/09/22 16:48:22, sadrul wrote:
> An alternate for this is:
> 
> #if defined(OS_CHROMEOS)
> #define PRODUCT_PATH "chromeos"
> #else
> #define PRODUCT_PATH "chrome"
> #endif
> 
> const char kCrashReasonURL[] =
>     "https://support.google.com/" PRODUCT_PATH "/?p=e_awsnap";
> const char kKillReasonURL[] =
>     "https://support.google.com/" PRODUCT_PATH "/?p=e_deadjim";

Done.

Powered by Google App Engine
This is Rietveld 408576698