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

Side by Side Diff: ash/frame/default_header_painter.cc

Issue 441803004: Introduce new WebApp header style for hosted apps and fizzy apps on ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Put some non-ash code back Created 6 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame/default_header_painter.h" 5 #include "ash/frame/default_header_painter.h"
6 6
7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 7 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
8 #include "ash/frame/header_painter_util.h" 8 #include "ash/frame/header_painter_util.h"
9 #include "base/debug/leak_annotations.h" 9 #include "base/debug/leak_annotations.h"
10 #include "base/logging.h" // DCHECK 10 #include "base/logging.h" // DCHECK
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 SkScalar y = SkIntToScalar(height_) - SkFloatToScalar(thickness); 312 SkScalar y = SkIntToScalar(height_) - SkFloatToScalar(thickness);
313 canvas->sk_canvas()->drawLine(0, y, SkIntToScalar(view_->width()), y, paint); 313 canvas->sk_canvas()->drawLine(0, y, SkIntToScalar(view_->width()), y, paint);
314 } 314 }
315 315
316 gfx::Rect DefaultHeaderPainter::GetLocalBounds() const { 316 gfx::Rect DefaultHeaderPainter::GetLocalBounds() const {
317 return gfx::Rect(view_->width(), height_); 317 return gfx::Rect(view_->width(), height_);
318 } 318 }
319 319
320 gfx::Rect DefaultHeaderPainter::GetTitleBounds() const { 320 gfx::Rect DefaultHeaderPainter::GetTitleBounds() const {
321 return HeaderPainterUtil::GetTitleBounds( 321 return HeaderPainterUtil::GetTitleBounds(
322 window_icon_, caption_button_container_, GetTitleFontList()); 322 GetViewToLeftOfTitle(), caption_button_container_, GetTitleFontList());
323 }
324
325 views::View* DefaultHeaderPainter::GetViewToLeftOfTitle() const {
326 return window_icon_;
323 } 327 }
324 328
325 gfx::ImageSkia* DefaultHeaderPainter::GetActiveFrameImage() const { 329 gfx::ImageSkia* DefaultHeaderPainter::GetActiveFrameImage() const {
326 return ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 330 return ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
327 IDR_AURA_WINDOW_HEADER_BASE); 331 IDR_AURA_WINDOW_HEADER_BASE);
328 } 332 }
329 333
330 gfx::ImageSkia* DefaultHeaderPainter::GetInactiveFrameImage() const { 334 gfx::ImageSkia* DefaultHeaderPainter::GetInactiveFrameImage() const {
331 int frame_image_id = (frame_->IsMaximized() || frame_->IsFullscreen()) ? 335 int frame_image_id = (frame_->IsMaximized() || frame_->IsFullscreen()) ?
332 IDR_AURA_WINDOW_HEADER_BASE : 336 IDR_AURA_WINDOW_HEADER_BASE :
333 IDR_AURA_WINDOW_HEADER_BASE_RESTORED_INACTIVE; 337 IDR_AURA_WINDOW_HEADER_BASE_RESTORED_INACTIVE;
334 return ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 338 return ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
335 frame_image_id); 339 frame_image_id);
336 } 340 }
337 341
338 } // namespace ash 342 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698