Chromium Code Reviews| Index: chrome/browser/ui/browser_commands.cc |
| diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc |
| index 13fd6faa1ee285410e749f112da391dfc4c59215..9ece431d8ddd640caf802ade5732db84dbbd9e30 100644 |
| --- a/chrome/browser/ui/browser_commands.cc |
| +++ b/chrome/browser/ui/browser_commands.cc |
| @@ -877,12 +877,15 @@ void Print(Browser* browser) { |
| bool CanPrint(Browser* browser) { |
| // Do not print when printing is disabled via pref or policy. |
| + // Do not print when a page has crashed. |
| // Do not print when a constrained window is showing. It's confusing. |
| // TODO(gbillock): Need to re-assess the call to |
| // IsShowingWebContentsModalDialog after a popup management policy is |
| // refined -- we will probably want to just queue the print request, not |
| // block it. |
| + WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); |
| return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && |
| + (current_tab != nullptr && !current_tab->IsCrashed()) && |
|
Peter Kasting
2016/03/29 02:55:13
Nit: "!= nullptr" usually gets omitted
Tom (Use chromium acct)
2016/03/31 17:13:44
Done.
|
| !(IsShowingWebContentsModalDialog(browser) || |
| GetContentRestrictions(browser) & CONTENT_RESTRICTION_PRINT); |
|
Peter Kasting
2016/03/29 02:55:13
Nit: While here: Seems like this line should be in
Tom (Use chromium acct)
2016/03/31 17:13:44
Done.
|
| } |