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

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

Issue 1430553004: Correctly align tab and toolbar backgrounds with the frame background. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix errors, better comments Created 5 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 // the tabstrip is on the top. 358 // the tabstrip is on the top.
359 gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR); 359 gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
360 int dest_y = y; 360 int dest_y = y;
361 // In the pre-MD world, the toolbar top edge is drawn using the 361 // In the pre-MD world, the toolbar top edge is drawn using the
362 // IDR_CONTENT_TOP_XXX images, which overlay the toolbar. The top 2 px of 362 // IDR_CONTENT_TOP_XXX images, which overlay the toolbar. The top 2 px of
363 // these images is the actual top edge, and is partly transparent, so the 363 // these images is the actual top edge, and is partly transparent, so the
364 // toolbar background shouldn't be drawn over it. 364 // toolbar background shouldn't be drawn over it.
365 const int kPreMDToolbarTopEdgeExclusion = 2; 365 const int kPreMDToolbarTopEdgeExclusion = 2;
366 if (browser_view()->IsTabStripVisible()) 366 if (browser_view()->IsTabStripVisible())
367 dest_y += kPreMDToolbarTopEdgeExclusion; 367 dest_y += kPreMDToolbarTopEdgeExclusion;
368 canvas->TileImageInt(*theme_toolbar, x + GetThemeBackgroundXInset(), 368 canvas->TileImageInt(
369 dest_y - GetTopInset(), x, dest_y, w, 369 *theme_toolbar, x + GetThemeBackgroundXInset(),
370 theme_toolbar->height()); 370 dest_y - GetTopInset() + Tab::GetYOffsetForActiveTabBackground(),
371 x, dest_y, w, theme_toolbar->height());
371 372
372 // Toolbar edges. 373 // Toolbar edges.
373 if (browser_view()->IsTabStripVisible()) { 374 if (browser_view()->IsTabStripVisible()) {
374 // Pre-Windows 10, we draw toolbar left and right edges and top corners, 375 // Pre-Windows 10, we draw toolbar left and right edges and top corners,
375 // partly atop the window border. In Windows 10+, we don't draw our own 376 // partly atop the window border. In Windows 10+, we don't draw our own
376 // window border but rather go right to the system border, so we need only 377 // window border but rather go right to the system border, so we need only
377 // draw the toolbar top edge. 378 // draw the toolbar top edge.
378 int center_x = x; 379 int center_x = x;
379 int center_w = w; 380 int center_w = w;
380 if (base::win::GetVersion() < base::win::VERSION_WIN10) { 381 if (base::win::GetVersion() < base::win::VERSION_WIN10) {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 static bool initialized = false; 634 static bool initialized = false;
634 if (!initialized) { 635 if (!initialized) {
635 for (int i = 0; i < kThrobberIconCount; ++i) { 636 for (int i = 0; i < kThrobberIconCount; ++i) {
636 throbber_icons_[i] = 637 throbber_icons_[i] =
637 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); 638 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i);
638 DCHECK(throbber_icons_[i]); 639 DCHECK(throbber_icons_[i]);
639 } 640 }
640 initialized = true; 641 initialized = true;
641 } 642 }
642 } 643 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/opaque_browser_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698