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

Side by Side Diff: ash/mus/non_client_frame_controller.cc

Issue 2542493002: Replace kCanMaximize/Minimize/Resize with kResizeBehavior. (Closed)
Patch Set: Fix int->bool compile issue. Created 4 years 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
« no previous file with comments | « ash/common/wm/window_state.cc ('k') | ash/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/common/wm/window_state.cc ('k') | ash/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698