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

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

Issue 1322323006: Change toolbar height for material design on Ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's comments Created 5 years, 3 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/glass_browser_frame_view.h" 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { 353 void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
354 ui::ThemeProvider* tp = GetThemeProvider(); 354 ui::ThemeProvider* tp = GetThemeProvider();
355 355
356 gfx::Rect toolbar_bounds(browser_view()->GetToolbarBounds()); 356 gfx::Rect toolbar_bounds(browser_view()->GetToolbarBounds());
357 gfx::Point toolbar_origin(toolbar_bounds.origin()); 357 gfx::Point toolbar_origin(toolbar_bounds.origin());
358 View::ConvertPointToTarget(browser_view(), this, &toolbar_origin); 358 View::ConvertPointToTarget(browser_view(), this, &toolbar_origin);
359 toolbar_bounds.set_origin(toolbar_origin); 359 toolbar_bounds.set_origin(toolbar_origin);
360 int x = toolbar_bounds.x(); 360 int x = toolbar_bounds.x();
361 int w = toolbar_bounds.width(); 361 int w = toolbar_bounds.width();
362 362
363 const bool mode_material = ui::MaterialDesignController::IsModeMaterial();
Peter Kasting 2015/09/09 22:41:53 When I asked for the opaque and glass frames to be
tdanderson 2015/09/10 19:48:25 Reverted these changes for now, though I'd like to
364
363 gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); 365 gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
364 gfx::ImageSkia* toolbar_center = tp->GetImageSkiaNamed( 366 gfx::ImageSkia* toolbar_center = tp->GetImageSkiaNamed(
365 IDR_CONTENT_TOP_CENTER); 367 mode_material ? IDR_THEME_TOOLBAR : IDR_CONTENT_TOP_CENTER);
366 368
367 // Tile the toolbar image starting at the frame edge on the left and where 369 // Tile the toolbar image starting at the frame edge on the left and where
368 // the tabstrip is on the top. 370 // the tabstrip is on the top.
369 int y = toolbar_bounds.y(); 371 int y = toolbar_bounds.y();
370 int dest_y = browser_view()->IsTabStripVisible() 372 int dest_y = browser_view()->IsTabStripVisible()
371 ? y + (kFrameShadowThickness * 2) 373 ? y + (kFrameShadowThickness * 2)
372 : y; 374 : y;
373 canvas->TileImageInt(*theme_toolbar, 375 canvas->TileImageInt(*theme_toolbar,
374 x + GetThemeBackgroundXInset(), 376 x + GetThemeBackgroundXInset(),
375 dest_y - GetTopInset(), x, 377 dest_y - GetTopInset(), x,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 414
413 // Right edge. 415 // Right edge.
414 canvas->DrawImageInt(*tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER), 416 canvas->DrawImageInt(*tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER),
415 right_x, y); 417 right_x, y);
416 } else { 418 } else {
417 canvas->TileImageInt(*toolbar_center, x, y, w, toolbar_center->height()); 419 canvas->TileImageInt(*toolbar_center, x, y, w, toolbar_center->height());
418 } 420 }
419 } 421 }
420 422
421 // Draw the content/toolbar separator. 423 // Draw the content/toolbar separator.
422 if (ui::MaterialDesignController::IsModeMaterial()) { 424 if (mode_material) {
423 toolbar_bounds.Inset(kClientEdgeThickness, 0); 425 toolbar_bounds.Inset(kClientEdgeThickness, 0);
424 BrowserView::Paint1pxHorizontalLine( 426 BrowserView::Paint1pxHorizontalLine(
425 canvas, 427 canvas,
426 ThemeProperties::GetDefaultColor( 428 ThemeProperties::GetDefaultColor(
427 ThemeProperties::COLOR_TOOLBAR_SEPARATOR), 429 ThemeProperties::COLOR_TOOLBAR_SEPARATOR),
428 toolbar_bounds); 430 toolbar_bounds);
429 } else { 431 } else {
430 canvas->FillRect( 432 canvas->FillRect(
431 gfx::Rect(x + kClientEdgeThickness, 433 gfx::Rect(x + kClientEdgeThickness,
432 toolbar_bounds.bottom() - kClientEdgeThickness, 434 toolbar_bounds.bottom() - kClientEdgeThickness,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 static bool initialized = false; 636 static bool initialized = false;
635 if (!initialized) { 637 if (!initialized) {
636 for (int i = 0; i < kThrobberIconCount; ++i) { 638 for (int i = 0; i < kThrobberIconCount; ++i) {
637 throbber_icons_[i] = 639 throbber_icons_[i] =
638 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); 640 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i);
639 DCHECK(throbber_icons_[i]); 641 DCHECK(throbber_icons_[i]);
640 } 642 }
641 initialized = true; 643 initialized = true;
642 } 644 }
643 } 645 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698