| 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 "ash/mus/non_client_frame_controller.h" | 5 #include "ash/mus/non_client_frame_controller.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 base::string16 title = window_->GetSharedProperty<base::string16>( | 391 base::string16 title = window_->GetSharedProperty<base::string16>( |
| 392 ui::mojom::WindowManager::kWindowTitle_Property); | 392 ui::mojom::WindowManager::kWindowTitle_Property); |
| 393 | 393 |
| 394 if (IsWindowJanky(window_)) | 394 if (IsWindowJanky(window_)) |
| 395 title += base::ASCIIToUTF16(" !! Not responding !!"); | 395 title += base::ASCIIToUTF16(" !! Not responding !!"); |
| 396 | 396 |
| 397 return title; | 397 return title; |
| 398 } | 398 } |
| 399 | 399 |
| 400 bool NonClientFrameController::CanResize() const { | 400 bool NonClientFrameController::CanResize() const { |
| 401 return window_ && | 401 return window_ && (::ash::mus::GetResizeBehavior(window_) & |
| 402 (GetResizeBehavior(window_) & ui::mojom::kResizeBehaviorCanResize) != | 402 ui::mojom::kResizeBehaviorCanResize); |
| 403 0; | |
| 404 } | 403 } |
| 405 | 404 |
| 406 bool NonClientFrameController::CanMaximize() const { | 405 bool NonClientFrameController::CanMaximize() const { |
| 407 return window_ && | 406 return window_ && (::ash::mus::GetResizeBehavior(window_) & |
| 408 (GetResizeBehavior(window_) & ui::mojom::kResizeBehaviorCanMaximize) != | 407 ui::mojom::kResizeBehaviorCanMaximize); |
| 409 0; | |
| 410 } | 408 } |
| 411 | 409 |
| 412 bool NonClientFrameController::CanMinimize() const { | 410 bool NonClientFrameController::CanMinimize() const { |
| 413 return window_ && | 411 return window_ && (::ash::mus::GetResizeBehavior(window_) & |
| 414 (GetResizeBehavior(window_) & ui::mojom::kResizeBehaviorCanMinimize) != | 412 ui::mojom::kResizeBehaviorCanMinimize); |
| 415 0; | |
| 416 } | 413 } |
| 417 | 414 |
| 418 bool NonClientFrameController::ShouldShowWindowTitle() const { | 415 bool NonClientFrameController::ShouldShowWindowTitle() const { |
| 419 // Only draw the title if the client hasn't declared any additional client | 416 // Only draw the title if the client hasn't declared any additional client |
| 420 // areas which might conflict with it. | 417 // areas which might conflict with it. |
| 421 return window_ && window_->additional_client_areas().empty(); | 418 return window_ && window_->additional_client_areas().empty(); |
| 422 } | 419 } |
| 423 | 420 |
| 424 views::ClientView* NonClientFrameController::CreateClientView( | 421 views::ClientView* NonClientFrameController::CreateClientView( |
| 425 views::Widget* widget) { | 422 views::Widget* widget) { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 } | 456 } |
| 460 } | 457 } |
| 461 | 458 |
| 462 void NonClientFrameController::OnWindowDestroyed(ui::Window* window) { | 459 void NonClientFrameController::OnWindowDestroyed(ui::Window* window) { |
| 463 window_->RemoveObserver(this); | 460 window_->RemoveObserver(this); |
| 464 window_ = nullptr; | 461 window_ = nullptr; |
| 465 } | 462 } |
| 466 | 463 |
| 467 } // namespace mus | 464 } // namespace mus |
| 468 } // namespace ash | 465 } // namespace ash |
| OLD | NEW |