OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/common/ash_layout_constants.h" | 9 #include "ash/common/ash_layout_constants.h" |
10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
11 #include "ash/common/frame/default_header_painter.h" | 11 #include "ash/common/frame/default_header_painter.h" |
12 #include "ash/common/frame/frame_border_hit_test.h" | 12 #include "ash/common/frame/frame_border_hit_test.h" |
13 #include "ash/common/frame/header_painter_util.h" | 13 #include "ash/common/frame/header_painter_util.h" |
14 #include "ash/common/material_design/material_design_controller.h" | |
15 #include "ash/common/wm_lookup.h" | 14 #include "ash/common/wm_lookup.h" |
16 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
17 #include "ash/common/wm_window.h" | 16 #include "ash/common/wm_window.h" |
18 #include "build/build_config.h" | 17 #include "build/build_config.h" |
19 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
20 #include "chrome/browser/extensions/extension_util.h" | 19 #include "chrome/browser/extensions/extension_util.h" |
21 #include "chrome/browser/profiles/profiles_state.h" | 20 #include "chrome/browser/profiles/profiles_state.h" |
22 #include "chrome/browser/themes/theme_properties.h" | 21 #include "chrome/browser/themes/theme_properties.h" |
23 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 22 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
24 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 frame()->GetRootView()->Layout(); | 368 frame()->GetRootView()->Layout(); |
370 } | 369 } |
371 } | 370 } |
372 | 371 |
373 /////////////////////////////////////////////////////////////////////////////// | 372 /////////////////////////////////////////////////////////////////////////////// |
374 // ash::ShellObserver: | 373 // ash::ShellObserver: |
375 | 374 |
376 void BrowserNonClientFrameViewAsh::OnOverviewModeStarting() { | 375 void BrowserNonClientFrameViewAsh::OnOverviewModeStarting() { |
377 frame()->GetNativeWindow()->SetProperty(aura::client::kTopViewColor, | 376 frame()->GetNativeWindow()->SetProperty(aura::client::kTopViewColor, |
378 GetFrameColor()); | 377 GetFrameColor()); |
379 if (ash::MaterialDesignController::IsOverviewMaterial()) | 378 caption_button_container_->SetVisible(false); |
380 caption_button_container_->SetVisible(false); | |
381 } | 379 } |
382 | 380 |
383 void BrowserNonClientFrameViewAsh::OnOverviewModeEnded() { | 381 void BrowserNonClientFrameViewAsh::OnOverviewModeEnded() { |
384 if (ash::MaterialDesignController::IsOverviewMaterial()) | 382 caption_button_container_->SetVisible(true); |
385 caption_button_container_->SetVisible(true); | |
386 } | 383 } |
387 | 384 |
388 void BrowserNonClientFrameViewAsh::OnMaximizeModeStarted() { | 385 void BrowserNonClientFrameViewAsh::OnMaximizeModeStarted() { |
389 caption_button_container_->UpdateSizeButtonVisibility(); | 386 caption_button_container_->UpdateSizeButtonVisibility(); |
390 InvalidateLayout(); | 387 InvalidateLayout(); |
391 frame()->client_view()->InvalidateLayout(); | 388 frame()->client_view()->InvalidateLayout(); |
392 frame()->GetRootView()->Layout(); | 389 frame()->GetRootView()->Layout(); |
393 } | 390 } |
394 | 391 |
395 void BrowserNonClientFrameViewAsh::OnMaximizeModeEnded() { | 392 void BrowserNonClientFrameViewAsh::OnMaximizeModeEnded() { |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 // TODO(pkasting): The "2 *" part of this makes no sense to me. | 574 // TODO(pkasting): The "2 *" part of this makes no sense to me. |
578 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, | 575 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, |
579 img_y, img_w, img_h); | 576 img_y, img_w, img_h); |
580 | 577 |
581 // Toolbar/content separator. | 578 // Toolbar/content separator. |
582 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, | 579 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, |
583 kClientEdgeThickness, 0); | 580 kClientEdgeThickness, 0); |
584 canvas->FillRect(toolbar_bounds, separator_color); | 581 canvas->FillRect(toolbar_bounds, separator_color); |
585 } | 582 } |
586 } | 583 } |
OLD | NEW |