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

Side by Side Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 1115093002: App launcher: Avoid a browser crash if the custom page renderer crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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/app_list/app_list_view_delegate.h" 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/custom_launcher_page_contents.h" 9 #include "apps/custom_launcher_page_contents.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 for (ScopedVector<apps::CustomLauncherPageContents>::const_iterator it = 707 for (ScopedVector<apps::CustomLauncherPageContents>::const_iterator it =
708 custom_page_contents_.begin(); 708 custom_page_contents_.begin();
709 it != custom_page_contents_.end(); 709 it != custom_page_contents_.end();
710 ++it) { 710 ++it) {
711 content::WebContents* web_contents = (*it)->web_contents(); 711 content::WebContents* web_contents = (*it)->web_contents();
712 712
713 // The web contents should belong to the current profile. 713 // The web contents should belong to the current profile.
714 DCHECK_EQ(profile_, web_contents->GetBrowserContext()); 714 DCHECK_EQ(profile_, web_contents->GetBrowserContext());
715 715
716 // Make the webview transparent. 716 // Make the webview transparent.
717 web_contents->GetRenderViewHost()->GetView()->SetBackgroundColor( 717 content::RenderWidgetHostView* render_view_host_view =
718 SK_ColorTRANSPARENT); 718 web_contents->GetRenderViewHost()->GetView();
719 // The RenderWidgetHostView may be null if the renderer has crashed.
720 if (render_view_host_view)
721 render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
719 722
720 views::WebView* web_view = 723 views::WebView* web_view =
721 new views::WebView(web_contents->GetBrowserContext()); 724 new views::WebView(web_contents->GetBrowserContext());
722 web_view->SetPreferredSize(size); 725 web_view->SetPreferredSize(size);
723 web_view->SetResizeBackgroundColor(SK_ColorTRANSPARENT); 726 web_view->SetResizeBackgroundColor(SK_ColorTRANSPARENT);
724 web_view->SetWebContents(web_contents); 727 web_view->SetWebContents(web_contents);
725 web_views.push_back(web_view); 728 web_views.push_back(web_view);
726 } 729 }
727 730
728 return web_views; 731 return web_views;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 815
813 // SigninManagerFactory is not a leaky singleton (unlike this class), and 816 // SigninManagerFactory is not a leaky singleton (unlike this class), and
814 // its destructor will check that it has no remaining observers. 817 // its destructor will check that it has no remaining observers.
815 scoped_observer_.RemoveAll(); 818 scoped_observer_.RemoveAll();
816 SigninManagerFactory::GetInstance()->RemoveObserver(this); 819 SigninManagerFactory::GetInstance()->RemoveObserver(this);
817 break; 820 break;
818 default: 821 default:
819 NOTREACHED(); 822 NOTREACHED();
820 } 823 }
821 } 824 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698