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

Side by Side Diff: chrome/browser/ui/sad_tab_helper.cc

Issue 2261793002: Bring the feedback button to the Mac sad tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Address second wave of comments, turn off feedback in non-Chrome builds Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/sad_tab.cc ('k') | chrome/browser/ui/views/sad_tab_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/sad_tab_helper.h" 5 #include "chrome/browser/ui/sad_tab_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/browser_shutdown.h" 9 #include "chrome/browser/browser_shutdown.h"
10 #include "chrome/browser/ui/sad_tab.h" 10 #include "chrome/browser/ui/sad_tab.h"
(...skipping 23 matching lines...) Expand all
34 } // namespace 34 } // namespace
35 35
36 SadTabHelper::~SadTabHelper() { 36 SadTabHelper::~SadTabHelper() {
37 } 37 }
38 38
39 SadTabHelper::SadTabHelper(content::WebContents* web_contents) 39 SadTabHelper::SadTabHelper(content::WebContents* web_contents)
40 : content::WebContentsObserver(web_contents) { 40 : content::WebContentsObserver(web_contents) {
41 } 41 }
42 42
43 void SadTabHelper::RenderViewReady() { 43 void SadTabHelper::RenderViewReady() {
44 if (sad_tab_) { 44 sad_tab_.reset();
45 sad_tab_->Close();
46 sad_tab_.reset();
47 }
48 } 45 }
49 46
50 void SadTabHelper::RenderProcessGone(base::TerminationStatus status) { 47 void SadTabHelper::RenderProcessGone(base::TerminationStatus status) {
51 // Only show the sad tab if we're not in browser shutdown, so that WebContents 48 // Only show the sad tab if we're not in browser shutdown, so that WebContents
52 // objects that are not in a browser (e.g., HTML dialogs) and thus are 49 // objects that are not in a browser (e.g., HTML dialogs) and thus are
53 // visible do not flash a sad tab page. 50 // visible do not flash a sad tab page.
54 if (browser_shutdown::GetShutdownType() != browser_shutdown::NOT_VALID) 51 if (browser_shutdown::GetShutdownType() != browser_shutdown::NOT_VALID)
55 return; 52 return;
56 53
57 if (sad_tab_) 54 if (sad_tab_)
58 return; 55 return;
59 56
60 if (chrome::SadTab::ShouldShow(status)) 57 if (chrome::SadTab::ShouldShow(status))
61 InstallSadTab(status); 58 InstallSadTab(status);
62 } 59 }
63 60
64 void SadTabHelper::InstallSadTab(base::TerminationStatus status) { 61 void SadTabHelper::InstallSadTab(base::TerminationStatus status) {
65 sad_tab_.reset(chrome::SadTab::Create( 62 sad_tab_.reset(chrome::SadTab::Create(
66 web_contents(), SadTabKindFromTerminationStatus(status))); 63 web_contents(), SadTabKindFromTerminationStatus(status)));
67 sad_tab_->Show();
68 } 64 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sad_tab.cc ('k') | chrome/browser/ui/views/sad_tab_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698