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

Unified Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 2628043002: Gtk3: Render a GtkHeaderBar as the background of the tab strip (Closed)
Patch Set: Handle custom frames Created 3 years, 11 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/ui/libgtkui/native_theme_gtk3.cc ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index c3623f8093da0bcaa83dee045fb13ced6a57600d..dce994dc75e7b14645611ef104216aacebe43cac 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -412,6 +412,14 @@ void OpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
if (frame()->IsFullscreen())
return; // Nothing is visible, so don't bother to paint.
+ frame_background_->set_frame_color(GetFrameColor());
+ frame_background_->set_use_custom_frame(frame()->UseCustomFrame());
+ frame_background_->set_is_active(ShouldPaintAsActive());
+ frame_background_->set_incognito(browser_view()->IsIncognito());
+ frame_background_->set_theme_image(GetFrameImage());
+ frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
+ frame_background_->set_top_area_height(GetTopAreaHeight());
+
if (layout_->IsTitleBarCondensed())
PaintMaximizedFrameBorder(canvas);
else
@@ -501,11 +509,8 @@ bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const {
}
int OpaqueBrowserFrameView::GetTopAreaHeight() const {
- // The top area height in dp (only used when there's no frame image).
- // TODO(pkasting): investigate removing this constant. See crbug.com/590301
- const int kHeight = 64;
const gfx::ImageSkia frame_image = GetFrameImage();
- int top_area_height = frame_image.isNull() ? kHeight : frame_image.height();
+ int top_area_height = frame_image.height(); // Returns 0 if isNull()
Peter Kasting 2017/01/17 21:05:16 Nit: Trailing period if you're keeping this commen
Tom (Use chromium acct) 2017/01/17 21:23:14 Done.
if (browser_view()->IsTabStripVisible()) {
top_area_height =
std::max(top_area_height,
@@ -516,11 +521,6 @@ int OpaqueBrowserFrameView::GetTopAreaHeight() const {
void OpaqueBrowserFrameView::PaintRestoredFrameBorder(
gfx::Canvas* canvas) const {
- frame_background_->set_frame_color(GetFrameColor());
- frame_background_->set_theme_image(GetFrameImage());
- frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
- frame_background_->set_top_area_height(GetTopAreaHeight());
-
const ui::ThemeProvider* tp = GetThemeProvider();
frame_background_->SetSideImages(
tp->GetImageSkiaNamed(IDR_WINDOW_LEFT_SIDE),
@@ -542,10 +542,6 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(
void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(
gfx::Canvas* canvas) const {
- frame_background_->set_frame_color(GetFrameColor());
- frame_background_->set_theme_image(GetFrameImage());
- frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
- frame_background_->set_top_area_height(GetTopAreaHeight());
frame_background_->set_maximized_top_inset(
GetTopInset(true) - GetTopInset(false));
frame_background_->PaintMaximized(canvas, this);
« no previous file with comments | « chrome/browser/ui/libgtkui/native_theme_gtk3.cc ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698