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

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

Issue 1159033008: Refactor ViewsDelegate singleton (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed review comments Created 5 years, 6 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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 return layout_->IconBounds(); 575 return layout_->IconBounds();
576 } 576 }
577 577
578 bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const { 578 bool OpaqueBrowserFrameView::ShouldShowWindowTitleBar() const {
579 // Do not show the custom title bar if the system title bar option is enabled. 579 // Do not show the custom title bar if the system title bar option is enabled.
580 if (!frame()->UseCustomFrame()) 580 if (!frame()->UseCustomFrame())
581 return false; 581 return false;
582 582
583 // Do not show caption buttons if the window manager is forcefully providing a 583 // Do not show caption buttons if the window manager is forcefully providing a
584 // title bar (e.g., in Ubuntu Unity, if the window is maximized). 584 // title bar (e.g., in Ubuntu Unity, if the window is maximized).
585 if (!views::ViewsDelegate::views_delegate) 585 if (!views::ViewsDelegate::GetInstance())
586 return true; 586 return true;
587 return !views::ViewsDelegate::views_delegate->WindowManagerProvidesTitleBar( 587 return !views::ViewsDelegate::GetInstance()->WindowManagerProvidesTitleBar(
588 IsMaximized()); 588 IsMaximized());
589 } 589 }
590 590
591 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { 591 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
592 frame_background_->set_frame_color(GetFrameColor()); 592 frame_background_->set_frame_color(GetFrameColor());
593 frame_background_->set_theme_image(GetFrameImage()); 593 frame_background_->set_theme_image(GetFrameImage());
594 frame_background_->set_theme_overlay_image(GetFrameOverlayImage()); 594 frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
595 frame_background_->set_top_area_height(GetTopAreaHeight()); 595 frame_background_->set_top_area_height(GetTopAreaHeight());
596 596
597 ui::ThemeProvider* tp = GetThemeProvider(); 597 ui::ThemeProvider* tp = GetThemeProvider();
598 frame_background_->SetSideImages( 598 frame_background_->SetSideImages(
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 client_area_bottom + kClientEdgeThickness - client_area_top), 831 client_area_bottom + kClientEdgeThickness - client_area_top),
832 toolbar_color); 832 toolbar_color);
833 canvas->FillRect(gfx::Rect(client_area_bounds.x(), client_area_bottom, 833 canvas->FillRect(gfx::Rect(client_area_bounds.x(), client_area_bottom,
834 client_area_bounds.width(), kClientEdgeThickness), 834 client_area_bounds.width(), kClientEdgeThickness),
835 toolbar_color); 835 toolbar_color);
836 canvas->FillRect(gfx::Rect(client_area_bounds.right(), client_area_top, 836 canvas->FillRect(gfx::Rect(client_area_bounds.right(), client_area_top,
837 kClientEdgeThickness, 837 kClientEdgeThickness,
838 client_area_bottom + kClientEdgeThickness - client_area_top), 838 client_area_bottom + kClientEdgeThickness - client_area_top),
839 toolbar_color); 839 toolbar_color);
840 } 840 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698