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

Unified Diff: chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc

Issue 2905523004: Making answer card to behave like other results. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/app_list/BUILD.gn » ('j') | ui/app_list/views/contents_view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc
diff --git a/chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc b/chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc
index d9ba2e5622d3dc1883112802bb3f3d0c50ceed1a..8899d26a29e4b8c2f3ef2df989bd33213c8382d9 100644
--- a/chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc
+++ b/chrome/browser/ui/app_list/search_answer_web_contents_delegate.cc
@@ -13,6 +13,8 @@
#include "chrome/browser/ui/browser_navigator_params.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host.h"
+#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/renderer_preferences.h"
@@ -159,6 +161,14 @@ void SearchAnswerWebContentsDelegate::Update() {
// We are going to call WebContents::GetPreferredSize().
web_contents_->GetRenderViewHost()->EnablePreferredSizeMode();
+
+ // Make the webview transparent since it's going to be shown on top of a
+ // highlightable button.
+ content::RenderWidgetHostView* render_view_host_view =
+ web_contents_->GetRenderViewHost()->GetWidget()->GetView();
+ // The RenderWidgetHostView may be null if the renderer has crashed.
+ if (render_view_host_view)
+ render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
xiyuan 2017/05/25 16:42:53 There might be a few edge cases. We had WebContent
vadimt 2017/05/25 20:15:16 Done.
}
void SearchAnswerWebContentsDelegate::UpdatePreferredSize(
@@ -168,8 +178,7 @@ void SearchAnswerWebContentsDelegate::UpdatePreferredSize(
IsCardSizeOk(pref_size) || features::IsAnswerCardDarkRunEnabled();
model_->SetSearchAnswerAvailable(is_card_size_ok_ && received_answer_ &&
!web_contents_->IsLoading());
- if (!features::IsAnswerCardDarkRunEnabled())
- web_view_->SetPreferredSize(pref_size);
+ web_view_->SetPreferredSize(pref_size);
if (!answer_loaded_time_.is_null()) {
UMA_HISTOGRAM_TIMES("SearchAnswer.ResizeAfterLoadTime",
base::TimeTicks::Now() - answer_loaded_time_);
« no previous file with comments | « no previous file | ui/app_list/BUILD.gn » ('j') | ui/app_list/views/contents_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698