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

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: Fixing build breakage. 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 | « chrome/browser/chromeos/login/ui/webui_login_view.cc ('k') | ui/app_list/BUILD.gn » ('j') | no next file with comments »
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..a0f9487b81b9526ba734af65bce7e9b3776403b5 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
@@ -21,6 +21,7 @@
#include "ui/app_list/app_list_features.h"
#include "ui/app_list/app_list_model.h"
#include "ui/app_list/search_box_model.h"
+#include "ui/views/controls/webview/web_contents_set_background_color.h"
#include "ui/views/controls/webview/webview.h"
#include "ui/views/widget/widget.h"
@@ -105,6 +106,11 @@ SearchAnswerWebContentsDelegate::SearchAnswerWebContentsDelegate(
web_view_->SetFocusBehavior(views::View::FocusBehavior::NEVER);
model->AddObserver(this);
+
+ // Make the webview transparent since it's going to be shown on top of a
+ // highlightable button.
+ views::WebContentsSetBackgroundColor::CreateForWebContentsWithColor(
+ web_contents_.get(), SK_ColorTRANSPARENT);
}
SearchAnswerWebContentsDelegate::~SearchAnswerWebContentsDelegate() {
@@ -168,8 +174,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 | « chrome/browser/chromeos/login/ui/webui_login_view.cc ('k') | ui/app_list/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698