Skip to content

Commit

Permalink
Make the custom launcher page's WebContents transparent.
Browse files Browse the repository at this point in the history
This CL makes the custom launcher page's background transparent. This
means that custom launcher pages won't need to match their background
color to the app list.

This CL also fixes an issue with a white background rendering when the
view is clipping to the bounds.

BUG=425444

Review URL: https://codereview.chromium.org/720803005

Cr-Commit-Position: refs/heads/master@{#304747}
  • Loading branch information
nik3daz authored and Commit bot committed Nov 19, 2014
1 parent e6fa25d commit 426dba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions chrome/browser/ui/app_list/app_list_view_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
Expand Down Expand Up @@ -635,6 +637,10 @@ std::vector<views::View*> AppListViewDelegate::CreateCustomPageWebViews(
// The web contents should belong to the current profile.
DCHECK_EQ(profile_, web_contents->GetBrowserContext());

// Make the webview transparent.
web_contents->GetRenderViewHost()->GetView()->SetBackgroundColor(
SK_ColorTRANSPARENT);

views::WebView* web_view =
new views::WebView(web_contents->GetBrowserContext());
web_view->SetPreferredSize(size);
Expand Down
2 changes: 1 addition & 1 deletion ui/views/controls/native/native_view_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void NativeViewHost::OnPaint(gfx::Canvas* canvas) {
//
// It would be nice if this used some approximation of the page's
// current background color.
if (native_wrapper_->HasInstalledClip())
if (fast_resize_ && native_wrapper_->HasInstalledClip())
canvas->FillRect(GetLocalBounds(), SK_ColorWHITE);
}

Expand Down

0 comments on commit 426dba9

Please sign in to comment.