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

Unified Diff: services/ui/ws/window_tree.cc

Issue 2710023007: Make WindowTree::SetModal() take the type. (Closed)
Patch Set: more code. Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/ws/window_tree.cc
diff --git a/services/ui/ws/window_tree.cc b/services/ui/ws/window_tree.cc
index f642e1f1c3291f98d25ebcc946bb1336a56e9068..9b73054c3177653609611136b6e5c69a13c7b584 100644
--- a/services/ui/ws/window_tree.cc
+++ b/services/ui/ws/window_tree.cc
@@ -352,18 +352,26 @@ bool WindowTree::DeleteWindow(const ClientWindowId& window_id) {
return tree && tree->DeleteWindowImpl(this, window);
}
-bool WindowTree::SetModal(const ClientWindowId& window_id) {
+bool WindowTree::SetModal(const ClientWindowId& window_id,
+ ModalType modal_type) {
ServerWindow* window = GetWindowByClientId(window_id);
if (window && access_policy_->CanSetModal(window)) {
WindowManagerDisplayRoot* display_root =
GetWindowManagerDisplayRoot(window);
- if (window->transient_parent()) {
- window->SetModal();
- } else if (user_id_ != InvalidUserId()) {
- if (display_root)
- display_root->window_manager_state()->AddSystemModalWindow(window);
- } else {
- return false;
+ switch (modal_type) {
+ case MODAL_TYPE_NONE:
+ window->SetModal(false);
sky 2017/02/24 20:18:53 I think SetModal should change to take the type.
Hadi 2017/02/28 20:29:07 Done.
+ break;
+ case MODAL_TYPE_WINDOW:
+ window->SetModal(true);
+ break;
+ case MODAL_TYPE_SYSTEM:
+ if (user_id_ != InvalidUserId() && display_root)
+ display_root->window_manager_state()->AddSystemModalWindow(window);
+ break;
+ case MODAL_TYPE_CHILD:
+ NOTIMPLEMENTED();
+ return false;
}
if (display_root)
display_root->window_manager_state()->ReleaseCaptureBlockedByModalWindow(
@@ -1278,8 +1286,11 @@ void WindowTree::RemoveTransientWindowFromParent(uint32_t change_id,
client()->OnChangeCompleted(change_id, success);
}
-void WindowTree::SetModal(uint32_t change_id, Id window_id) {
- client()->OnChangeCompleted(change_id, SetModal(ClientWindowId(window_id)));
+void WindowTree::SetModal(uint32_t change_id,
+ Id window_id,
+ ModalType modal_type) {
+ client()->OnChangeCompleted(change_id,
+ SetModal(ClientWindowId(window_id), modal_type));
}
void WindowTree::ReorderWindow(uint32_t change_id,

Powered by Google App Engine
This is Rietveld 408576698