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

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

Issue 9583032: Aura: Fix gray line at top of toolbar with translucent frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweak popup appearance Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_frame_aura.cc
diff --git a/chrome/browser/ui/views/frame/browser_frame_aura.cc b/chrome/browser/ui/views/frame/browser_frame_aura.cc
index e72d1694d8c42594fd4d925ebe94973f732c2ccf..1f7a604c53e0e95fa9d20ec3eb768abb5de367f3 100644
--- a/chrome/browser/ui/views/frame/browser_frame_aura.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_aura.cc
@@ -8,97 +8,16 @@
#include "ash/shell.h"
#include "base/command_line.h"
#include "chrome/browser/chromeos/status/status_area_view.h"
-#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/views/ash/chrome_shell_delegate.h"
-#include "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
-#include "grit/theme_resources_standard.h"
-#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/core/SkCanvas.h"
-#include "third_party/skia/include/core/SkColor.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/aura/window_observer.h"
-#include "ui/base/theme_provider.h"
-#include "ui/gfx/canvas.h"
-#include "ui/gfx/compositor/layer.h"
#include "ui/gfx/font.h"
#include "ui/views/background.h"
namespace {
-// The content left/right images have a shadow built into them.
-const int kContentEdgeShadowThickness = 2;
-
-// Background view to paint the gradient behind the back/forward/omnibox
-// toolbar area.
-class ToolbarBackground : public views::Background {
- public:
- explicit ToolbarBackground(BrowserView* browser_view);
- virtual ~ToolbarBackground();
-
- // views::Background overrides:
- virtual void Paint(gfx::Canvas* canvas, views::View* view) const OVERRIDE;
-
- private:
- BrowserView* browser_view_;
- DISALLOW_COPY_AND_ASSIGN(ToolbarBackground);
-};
-
-ToolbarBackground::ToolbarBackground(BrowserView* browser_view)
- : browser_view_(browser_view) {
-}
-
-ToolbarBackground::~ToolbarBackground() {
-}
-
-void ToolbarBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
- gfx::Rect toolbar_bounds = browser_view_->GetToolbarBounds();
- if (toolbar_bounds.IsEmpty())
- return;
-
- int x = toolbar_bounds.x();
- int w = toolbar_bounds.width();
- int y = toolbar_bounds.y();
- int h = toolbar_bounds.bottom();
-
- // Gross hack: We split the toolbar images into two pieces, since sometimes
- // (popup mode) the toolbar isn't tall enough to show the whole image. The
- // split happens between the top shadow section and the bottom gradient
- // section so that we never break the gradient.
- int split_point = views::NonClientFrameView::kFrameShadowThickness * 2;
- int bottom_y = y + split_point;
- ui::ThemeProvider* tp = browser_view_->GetThemeProvider();
- SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER);
- int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point;
-
- canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height),
- tp->GetColor(ThemeService::COLOR_TOOLBAR));
-
- // Tile the toolbar image starting at the frame edge on the left and where the
- // horizontal tabstrip is (or would be) on the top.
- SkBitmap* theme_toolbar = tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
- canvas->TileImageInt(*theme_toolbar,
- x, bottom_y,
- x, bottom_y,
- w, theme_toolbar->height());
-
- SkBitmap* toolbar_center =
- tp->GetBitmapNamed(IDR_CONTENT_TOP_CENTER);
- canvas->TileImageInt(*toolbar_center,
- 0, 0,
- x, y,
- w, split_point);
-
- // Draw the content/toolbar separator.
- canvas->FillRect(gfx::Rect(
- x + views::NonClientFrameView::kClientEdgeThickness,
- toolbar_bounds.bottom() - views::NonClientFrameView::kClientEdgeThickness,
- w - (2 * views::NonClientFrameView::kClientEdgeThickness),
- views::NonClientFrameView::kClientEdgeThickness),
- ThemeService::GetDefaultColor(ThemeService::COLOR_TOOLBAR_SEPARATOR));
-}
-
////////////////////////////////////////////////////////////////////////////////
// StatusAreaBoundsWatcher
@@ -212,11 +131,6 @@ BrowserFrameAura::BrowserFrameAura(BrowserFrame* browser_frame,
: views::NativeWidgetAura(browser_frame),
browser_view_(browser_view),
window_property_watcher_(new WindowPropertyWatcher(this, browser_frame)) {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(ash::switches::kAuraTranslucentFrames)) {
- // Background only needed for Aura-style windows.
- browser_view_->set_background(new ToolbarBackground(browser_view));
- }
GetNativeWindow()->SetName("BrowserFrameAura");
GetNativeWindow()->AddObserver(window_property_watcher_.get());
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698