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

Side by Side Diff: ash/wm/frame_painter.cc

Issue 12212207: Support panel titles and Icons for v1 apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/wm/panel_frame_view.h » ('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 "ash/wm/frame_painter.h" 5 #include "ash/wm/frame_painter.h"
6 6
7 #include "ash/ash_constants.h" 7 #include "ash/ash_constants.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/property_util.h" 10 #include "ash/wm/property_util.h"
(...skipping 26 matching lines...) Expand all
37 using aura::RootWindow; 37 using aura::RootWindow;
38 using aura::Window; 38 using aura::Window;
39 39
40 namespace { 40 namespace {
41 // TODO(jamescook): Border is specified to be a single pixel overlapping 41 // TODO(jamescook): Border is specified to be a single pixel overlapping
42 // the web content and may need to be built into the shadow layers instead. 42 // the web content and may need to be built into the shadow layers instead.
43 const int kBorderThickness = 0; 43 const int kBorderThickness = 0;
44 // Space between left edge of window and popup window icon. 44 // Space between left edge of window and popup window icon.
45 const int kIconOffsetX = 9; 45 const int kIconOffsetX = 9;
46 // Space between top of window and popup window icon. 46 // Space between top of window and popup window icon.
47 const int kIconOffsetY = 9; 47 const int kIconOffsetY = 5;
48 // Height and width of window icon. 48 // Height and width of window icon.
49 const int kIconSize = 16; 49 const int kIconSize = 16;
50 // Space between the title text and the caption buttons. 50 // Space between the title text and the caption buttons.
51 const int kTitleLogoSpacing = 5; 51 const int kTitleLogoSpacing = 5;
52 // Space between window icon and title text. 52 // Space between window icon and title text.
53 const int kTitleIconOffsetX = 4; 53 const int kTitleIconOffsetX = 4;
54 // Space between window edge and title text, when there is no icon. 54 // Space between window edge and title text, when there is no icon.
55 const int kTitleNoIconOffsetX = 8; 55 const int kTitleNoIconOffsetX = 8;
56 // Color for the title text. 56 // Color for the title text.
57 const SkColor kTitleTextColor = SkColorSetRGB(40, 40, 40); 57 const SkColor kTitleTextColor = SkColorSetRGB(40, 40, 40);
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 if (immersive_button_) { 587 if (immersive_button_) {
588 gfx::Size immersive_size = immersive_button_->GetPreferredSize(); 588 gfx::Size immersive_size = immersive_button_->GetPreferredSize();
589 // TODO(jamescook): Fix layout when we have real art. 589 // TODO(jamescook): Fix layout when we have real art.
590 immersive_button_->SetBounds( 590 immersive_button_->SetBounds(
591 size_button_->x() - immersive_size.width() - kImmersiveButtonOffsetX, 591 size_button_->x() - immersive_size.width() - kImmersiveButtonOffsetX,
592 size_button_->y(), 592 size_button_->y(),
593 immersive_size.width(), 593 immersive_size.width(),
594 immersive_size.height()); 594 immersive_size.height());
595 } 595 }
596 596
597 if (window_icon_) 597 if (window_icon_) {
598 window_icon_->SetBoundsRect( 598 window_icon_->SetBoundsRect(
599 gfx::Rect(kIconOffsetX, kIconOffsetY, kIconSize, kIconSize)); 599 gfx::Rect(kIconOffsetX, kIconOffsetY, kIconSize, kIconSize));
600 }
600 } 601 }
601 602
602 void FramePainter::SchedulePaintForTitle(views::NonClientFrameView* view, 603 void FramePainter::SchedulePaintForTitle(views::NonClientFrameView* view,
603 const gfx::Font& title_font) { 604 const gfx::Font& title_font) {
604 frame_->non_client_view()->SchedulePaintInRect( 605 frame_->non_client_view()->SchedulePaintInRect(
605 GetTitleBounds(view, title_font)); 606 GetTitleBounds(view, title_font));
606 } 607 }
607 608
608 /////////////////////////////////////////////////////////////////////////////// 609 ///////////////////////////////////////////////////////////////////////////////
609 // aura::WindowObserver overrides: 610 // aura::WindowObserver overrides:
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 int title_y = 874 int title_y =
874 (view->GetBoundsForClientView().y() - title_font.GetHeight()) / 2; 875 (view->GetBoundsForClientView().y() - title_font.GetHeight()) / 2;
875 return gfx::Rect( 876 return gfx::Rect(
876 title_x, 877 title_x,
877 std::max(0, title_y), 878 std::max(0, title_y),
878 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x), 879 std::max(0, size_button_->x() - kTitleLogoSpacing - title_x),
879 title_font.GetHeight()); 880 title_font.GetHeight());
880 } 881 }
881 882
882 } // namespace ash 883 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/panel_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698