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

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc

Issue 2682803003: Gtk3: Add themable location bar border color (Closed)
Patch Set: Rename new theme property Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/themes/theme_service_factory.h" 9 #include "chrome/browser/themes/theme_service_factory.h"
10 #include "chrome/browser/ui/layout_constants.h" 10 #include "chrome/browser/ui/layout_constants.h"
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_CENTER); 638 tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_CENTER);
639 canvas->TileImageInt(*bottom_image, x, bottom, w, bottom_image->height()); 639 canvas->TileImageInt(*bottom_image, x, bottom, w, bottom_image->height());
640 canvas->DrawImageInt(*tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER), 640 canvas->DrawImageInt(*tp->GetImageSkiaNamed(IDR_CONTENT_BOTTOM_LEFT_CORNER),
641 x - img_w, bottom); 641 x - img_w, bottom);
642 canvas->TileImageInt(*tp->GetImageSkiaNamed(IDR_CONTENT_LEFT_SIDE), x - img_w, 642 canvas->TileImageInt(*tp->GetImageSkiaNamed(IDR_CONTENT_LEFT_SIDE), x - img_w,
643 y, img_w, height); 643 y, img_w, height);
644 FillClientEdgeRects(x, y, w, height, true, toolbar_color, canvas); 644 FillClientEdgeRects(x, y, w, height, true, toolbar_color, canvas);
645 645
646 // For popup windows, draw location bar sides. 646 // For popup windows, draw location bar sides.
647 if (!tabstrip_visible && IsToolbarVisible()) { 647 if (!tabstrip_visible && IsToolbarVisible()) {
648 FillClientEdgeRects(x, y, w, toolbar_bounds.height(), false, 648 FillClientEdgeRects(
649 LocationBarView::GetOpaqueBorderColor(incognito), 649 x, y, w, toolbar_bounds.height(), false,
650 canvas); 650 browser_view()->toolbar()->location_bar()->GetOpaqueBorderColor(
sky 2017/02/08 23:25:55 optional: this is a bit unwieldy to read, consider
Tom (Use chromium acct) 2017/02/09 05:22:15 Done.
651 incognito),
652 canvas);
651 } 653 }
652 } 654 }
653 655
654 void OpaqueBrowserFrameView::FillClientEdgeRects(int x, 656 void OpaqueBrowserFrameView::FillClientEdgeRects(int x,
655 int y, 657 int y,
656 int w, 658 int w,
657 int h, 659 int h,
658 bool draw_bottom, 660 bool draw_bottom,
659 SkColor color, 661 SkColor color,
660 gfx::Canvas* canvas) const { 662 gfx::Canvas* canvas) const {
661 x -= kClientEdgeThickness; 663 x -= kClientEdgeThickness;
662 gfx::Rect side(x, y, kClientEdgeThickness, h); 664 gfx::Rect side(x, y, kClientEdgeThickness, h);
663 canvas->FillRect(side, color); 665 canvas->FillRect(side, color);
664 if (draw_bottom) { 666 if (draw_bottom) {
665 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), 667 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness),
666 kClientEdgeThickness), 668 kClientEdgeThickness),
667 color); 669 color);
668 } 670 }
669 side.Offset(w + kClientEdgeThickness, 0); 671 side.Offset(w + kClientEdgeThickness, 0);
670 canvas->FillRect(side, color); 672 canvas->FillRect(side, color);
671 } 673 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtkui/gtk_ui.cc ('k') | chrome/browser/ui/views/location_bar/location_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698