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

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

Issue 271913002: Animate window control changes in TouchView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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/browser_non_client_frame_view_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
6 6
7 #include <algorithm>
8
7 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/frame/default_header_painter.h" 11 #include "ash/frame/default_header_painter.h"
10 #include "ash/frame/frame_border_hit_test_controller.h" 12 #include "ash/frame/frame_border_hit_test_controller.h"
11 #include "ash/frame/header_painter_util.h" 13 #include "ash/frame/header_painter_util.h"
12 #include "ash/shell.h" 14 #include "ash/shell.h"
13 #include "base/command_line.h" 15 #include "base/command_line.h"
14 #include "chrome/browser/themes/theme_properties.h" 16 #include "chrome/browser/themes/theme_properties.h"
15 #include "chrome/browser/ui/browser.h" 17 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/views/frame/browser_frame.h" 18 #include "chrome/browser/ui/views/frame/browser_frame.h"
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 372 }
371 373
372 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { 374 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() {
373 views::WidgetDelegate* delegate = frame()->widget_delegate(); 375 views::WidgetDelegate* delegate = frame()->widget_delegate();
374 if (!delegate) 376 if (!delegate)
375 return gfx::ImageSkia(); 377 return gfx::ImageSkia();
376 return delegate->GetWindowIcon(); 378 return delegate->GetWindowIcon();
377 } 379 }
378 380
379 /////////////////////////////////////////////////////////////////////////////// 381 ///////////////////////////////////////////////////////////////////////////////
382 // views::View:
383
384 void BrowserNonClientFrameViewAsh::
385 ChildPreferredSizeChanged(views::View* child) {
386 // FrameCaptionButtonContainerView animates the visibility changes in
387 // UpdateSizeButtonVisibility(false). Due to this a new size is not
388 // available
flackr 2014/05/16 18:40:12 nit: bad wrapping.
jonross 2014/05/16 19:50:01 Done.
389 // until the completion of the animation. Layout it response to the
flackr 2014/05/16 18:40:12 s/it/in
jonross 2014/05/16 19:50:01 Done.
390 // preferred
391 // size changes.
392 if (child != caption_button_container_)
393 return;
394 frame()->GetRootView()->Layout();
395 }
396
397 ///////////////////////////////////////////////////////////////////////////////
380 // BrowserNonClientFrameViewAsh, private: 398 // BrowserNonClientFrameViewAsh, private:
381 399
382 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { 400 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const {
383 return avatar_button() ? kAvatarSideSpacing + 401 return avatar_button() ? kAvatarSideSpacing +
384 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : 402 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing :
385 kTabstripLeftSpacing; 403 kTabstripLeftSpacing;
386 } 404 }
387 405
388 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { 406 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const {
389 return caption_button_container_->GetPreferredSize().width() + 407 return caption_button_container_->GetPreferredSize().width() +
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); 551 ThemeProperties::COLOR_TOOLBAR_SEPARATOR));
534 } 552 }
535 553
536 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { 554 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) {
537 DCHECK(!UsePackagedAppHeaderStyle()); 555 DCHECK(!UsePackagedAppHeaderStyle());
538 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), 556 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(),
539 width(), kClientEdgeThickness), 557 width(), kClientEdgeThickness),
540 ThemeProperties::GetDefaultColor( 558 ThemeProperties::GetDefaultColor(
541 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); 559 ThemeProperties::COLOR_TOOLBAR_SEPARATOR));
542 } 560 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698