| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/frame/non_client_frame_view_mash.h" | 5 #include "mash/wm/frame/non_client_frame_view_mash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "components/mus/public/cpp/window.h" | 12 #include "components/mus/public/cpp/window.h" |
| 12 #include "components/mus/public/cpp/window_tree_connection.h" | 13 #include "components/mus/public/cpp/window_tree_connection.h" |
| 13 #include "grit/mash_wm_resources.h" | 14 #include "grit/mash_wm_resources.h" |
| 14 #include "mash/wm/frame/caption_buttons/frame_caption_button_container_view.h" | 15 #include "mash/wm/frame/caption_buttons/frame_caption_button_container_view.h" |
| 15 #include "mash/wm/frame/default_header_painter.h" | 16 #include "mash/wm/frame/default_header_painter.h" |
| 16 #include "mash/wm/frame/frame_border_hit_test_controller.h" | 17 #include "mash/wm/frame/frame_border_hit_test_controller.h" |
| 17 #include "mash/wm/frame/header_painter.h" | 18 #include "mash/wm/frame/header_painter.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 64 |
| 64 FrameCaptionButtonContainerView* caption_button_container() { | 65 FrameCaptionButtonContainerView* caption_button_container() { |
| 65 return caption_button_container_; | 66 return caption_button_container_; |
| 66 } | 67 } |
| 67 | 68 |
| 68 private: | 69 private: |
| 69 // The widget that the caption buttons act on. | 70 // The widget that the caption buttons act on. |
| 70 views::Widget* frame_; | 71 views::Widget* frame_; |
| 71 | 72 |
| 72 // Helper for painting the header. | 73 // Helper for painting the header. |
| 73 scoped_ptr<DefaultHeaderPainter> header_painter_; | 74 std::unique_ptr<DefaultHeaderPainter> header_painter_; |
| 74 | 75 |
| 75 // View which contains the window caption buttons. | 76 // View which contains the window caption buttons. |
| 76 FrameCaptionButtonContainerView* caption_button_container_; | 77 FrameCaptionButtonContainerView* caption_button_container_; |
| 77 | 78 |
| 78 mus::Window* window_; | 79 mus::Window* window_; |
| 79 | 80 |
| 80 DISALLOW_COPY_AND_ASSIGN(HeaderView); | 81 DISALLOW_COPY_AND_ASSIGN(HeaderView); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 NonClientFrameViewMash::HeaderView::HeaderView(views::Widget* frame, | 84 NonClientFrameViewMash::HeaderView::HeaderView(views::Widget* frame, |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 void NonClientFrameViewMash::OnWindowTreeFocusChanged(mus::Window* gained_focus, | 354 void NonClientFrameViewMash::OnWindowTreeFocusChanged(mus::Window* gained_focus, |
| 354 mus::Window* lost_focus) { | 355 mus::Window* lost_focus) { |
| 355 const bool had_focus = lost_focus && window_->Contains(lost_focus); | 356 const bool had_focus = lost_focus && window_->Contains(lost_focus); |
| 356 const bool has_focus = gained_focus && window_->Contains(gained_focus); | 357 const bool has_focus = gained_focus && window_->Contains(gained_focus); |
| 357 if (had_focus != has_focus) | 358 if (had_focus != has_focus) |
| 358 SchedulePaint(); | 359 SchedulePaint(); |
| 359 } | 360 } |
| 360 | 361 |
| 361 } // namespace wm | 362 } // namespace wm |
| 362 } // namespace mash | 363 } // namespace mash |
| OLD | NEW |