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

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

Issue 10821002: Makes the min window size include the OTR image and caption buttons on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 8 years, 5 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 | « ash/wm/frame_painter.h ('k') | chrome/browser/ui/panels/panel_browser_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/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "base/logging.h" // DCHECK 10 #include "base/logging.h" // DCHECK
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // the title string to collapse to zero width. 286 // the title string to collapse to zero width.
287 int title_width = GetTitleOffsetX() + 287 int title_width = GetTitleOffsetX() +
288 size_button_->width() - 288 size_button_->width() -
289 kButtonOverlap + 289 kButtonOverlap +
290 close_button_->width(); 290 close_button_->width();
291 if (title_width > min_size.width()) 291 if (title_width > min_size.width())
292 min_size.set_width(title_width); 292 min_size.set_width(title_width);
293 return min_size; 293 return min_size;
294 } 294 }
295 295
296 int FramePainter::GetRightInset() const {
297 gfx::Size close_size = close_button_->GetPreferredSize();
298 gfx::Size size_button_size = size_button_->GetPreferredSize();
299 return close_size.width() + kCloseButtonOffsetX + size_button_size.width() -
300 kButtonOverlap;
301 }
302
296 void FramePainter::PaintHeader(views::NonClientFrameView* view, 303 void FramePainter::PaintHeader(views::NonClientFrameView* view,
297 gfx::Canvas* canvas, 304 gfx::Canvas* canvas,
298 HeaderMode header_mode, 305 HeaderMode header_mode,
299 int theme_frame_id, 306 int theme_frame_id,
300 const gfx::ImageSkia* theme_frame_overlay) { 307 const gfx::ImageSkia* theme_frame_overlay) {
301 if (previous_theme_frame_id_ != 0 && 308 if (previous_theme_frame_id_ != 0 &&
302 previous_theme_frame_id_ != theme_frame_id) { 309 previous_theme_frame_id_ != theme_frame_id) {
303 crossfade_animation_.reset(new ui::SlideAnimation(this)); 310 crossfade_animation_.reset(new ui::SlideAnimation(this));
304 crossfade_theme_frame_id_ = previous_theme_frame_id_; 311 crossfade_theme_frame_id_ = previous_theme_frame_id_;
305 crossfade_opacity_ = previous_opacity_; 312 crossfade_opacity_ = previous_opacity_;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 for (std::set<FramePainter*>::const_iterator it = instances_->begin(); 623 for (std::set<FramePainter*>::const_iterator it = instances_->begin();
617 it != instances_->end(); 624 it != instances_->end();
618 ++it) { 625 ++it) {
619 FramePainter* painter = *it; 626 FramePainter* painter = *it;
620 if (IsVisibleNormalWindow(painter->window_)) 627 if (IsVisibleNormalWindow(painter->window_))
621 painter->frame_->non_client_view()->SchedulePaint(); 628 painter->frame_->non_client_view()->SchedulePaint();
622 } 629 }
623 } 630 }
624 631
625 } // namespace ash 632 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/frame_painter.h ('k') | chrome/browser/ui/panels/panel_browser_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698