| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/dock/docked_window_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "base/metrics/histogram.h" | 24 #include "base/metrics/histogram.h" |
| 25 #include "grit/ash_resources.h" | 25 #include "grit/ash_resources.h" |
| 26 #include "third_party/skia/include/core/SkColor.h" | 26 #include "third_party/skia/include/core/SkColor.h" |
| 27 #include "third_party/skia/include/core/SkPaint.h" | 27 #include "third_party/skia/include/core/SkPaint.h" |
| 28 #include "ui/aura/client/focus_client.h" | 28 #include "ui/aura/client/focus_client.h" |
| 29 #include "ui/aura/client/window_tree_client.h" | 29 #include "ui/aura/client/window_tree_client.h" |
| 30 #include "ui/aura/window.h" | 30 #include "ui/aura/window.h" |
| 31 #include "ui/aura/window_delegate.h" | 31 #include "ui/aura/window_delegate.h" |
| 32 #include "ui/aura/window_event_dispatcher.h" | 32 #include "ui/aura/window_event_dispatcher.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/compositor/paint_context.h" |
| 34 #include "ui/compositor/scoped_layer_animation_settings.h" | 35 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 35 #include "ui/gfx/canvas.h" | 36 #include "ui/gfx/canvas.h" |
| 36 #include "ui/gfx/geometry/rect.h" | 37 #include "ui/gfx/geometry/rect.h" |
| 37 #include "ui/gfx/image/image_skia_operations.h" | 38 #include "ui/gfx/image/image_skia_operations.h" |
| 38 #include "ui/views/background.h" | 39 #include "ui/views/background.h" |
| 39 #include "ui/wm/core/window_util.h" | 40 #include "ui/wm/core/window_util.h" |
| 40 #include "ui/wm/public/activation_client.h" | 41 #include "ui/wm/public/activation_client.h" |
| 41 | 42 |
| 42 namespace ash { | 43 namespace ash { |
| 43 | 44 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if (IsVisible()) | 86 if (IsVisible()) |
| 86 UpdateBackground(); | 87 UpdateBackground(); |
| 87 } | 88 } |
| 88 | 89 |
| 89 // views::Widget: | 90 // views::Widget: |
| 90 void OnNativeWidgetVisibilityChanged(bool visible) override { | 91 void OnNativeWidgetVisibilityChanged(bool visible) override { |
| 91 views::Widget::OnNativeWidgetVisibilityChanged(visible); | 92 views::Widget::OnNativeWidgetVisibilityChanged(visible); |
| 92 UpdateBackground(); | 93 UpdateBackground(); |
| 93 } | 94 } |
| 94 | 95 |
| 95 void OnNativeWidgetPaint(gfx::Canvas* canvas) override { | 96 void OnNativeWidgetPaint(const ui::PaintContext& context) override { |
| 97 gfx::Canvas* canvas = context.canvas(); |
| 96 const gfx::ImageSkia& shelf_background( | 98 const gfx::ImageSkia& shelf_background( |
| 97 alignment_ == DOCKED_ALIGNMENT_LEFT ? | 99 alignment_ == DOCKED_ALIGNMENT_LEFT ? |
| 98 shelf_background_left_ : shelf_background_right_); | 100 shelf_background_left_ : shelf_background_right_); |
| 99 gfx::Rect rect = gfx::Rect(GetWindowBoundsInScreen().size()); | 101 gfx::Rect rect = gfx::Rect(GetWindowBoundsInScreen().size()); |
| 100 SkPaint paint; | 102 SkPaint paint; |
| 101 paint.setAlpha(alpha_); | 103 paint.setAlpha(alpha_); |
| 102 canvas->DrawImageInt(shelf_background, | 104 canvas->DrawImageInt(shelf_background, |
| 103 0, | 105 0, |
| 104 0, | 106 0, |
| 105 shelf_background.width(), | 107 shelf_background.width(), |
| (...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 | 1364 |
| 1363 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1365 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1364 const gfx::Rect& keyboard_bounds) { | 1366 const gfx::Rect& keyboard_bounds) { |
| 1365 // This bounds change will have caused a change to the Shelf which does not | 1367 // This bounds change will have caused a change to the Shelf which does not |
| 1366 // propagate automatically to this class, so manually recalculate bounds. | 1368 // propagate automatically to this class, so manually recalculate bounds. |
| 1367 Relayout(); | 1369 Relayout(); |
| 1368 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1370 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1369 } | 1371 } |
| 1370 | 1372 |
| 1371 } // namespace ash | 1373 } // namespace ash |
| OLD | NEW |