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

Unified Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 1884043002: Use black for resize gutter in tab fullscreen mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: content/browser/renderer_host/delegated_frame_host.cc
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
index cef537d39b0e64fd7b7137667b296338eaa1b043..109c4a0ca59f183a1c14ec4f123687d65f47177c 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -256,16 +256,26 @@ void DelegatedFrameHost::WasResized() {
UpdateGutters();
}
+SkColor DelegatedFrameHost::GetGutterColor() const {
+ // In fullscreen mode resizing is uncommon, so it makes more sense to
+ // make the initial switch to fullscreen mode look better by using black as
+ // the gutter color.
+ SkColor color = background_color_;
+ client_->DelegatedFrameHostOverrideGutterColor(&color);
danakj 2016/04/25 22:17:58 nit: i think maybe passing the color and returning
+ return color;
+}
+
void DelegatedFrameHost::UpdateGutters() {
if (surface_id_.is_null()) {
right_gutter_.reset();
bottom_gutter_.reset();
return;
}
+
if (current_frame_size_in_dip_.width() <
client_->DelegatedFrameHostDesiredSizeInDIP().width()) {
right_gutter_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
- right_gutter_->SetColor(background_color_);
+ right_gutter_->SetColor(GetGutterColor());
int width = client_->DelegatedFrameHostDesiredSizeInDIP().width() -
current_frame_size_in_dip_.width();
// The right gutter also includes the bottom-right corner, if necessary.
@@ -281,7 +291,7 @@ void DelegatedFrameHost::UpdateGutters() {
if (current_frame_size_in_dip_.height() <
client_->DelegatedFrameHostDesiredSizeInDIP().height()) {
bottom_gutter_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
- bottom_gutter_->SetColor(background_color_);
+ bottom_gutter_->SetColor(GetGutterColor());
int width = current_frame_size_in_dip_.width();
int height = client_->DelegatedFrameHostDesiredSizeInDIP().height() -
current_frame_size_in_dip_.height();

Powered by Google App Engine
This is Rietveld 408576698