Chromium Code Reviews| Index: ash/common/wm/default_state.cc |
| diff --git a/ash/common/wm/default_state.cc b/ash/common/wm/default_state.cc |
| index e7aa9e21265f821e039772f6541ea056e37a9cbb..64db72690197765af7fa9650660bcae642ced37f 100644 |
| --- a/ash/common/wm/default_state.cc |
| +++ b/ash/common/wm/default_state.cc |
| @@ -205,6 +205,7 @@ void DefaultState::OnWMEvent(WindowState* window_state, const WMEvent* event) { |
| next_state_type = WINDOW_STATE_TYPE_INACTIVE; |
| break; |
| case WM_EVENT_PIN: |
| + case WM_EVENT_TRUSTED_PIN: |
| // If there already is a pinned window, it is not allowed to set it |
| // to this window. |
| // TODO(hidehiko): If a system modal window is openening, the pinning |
| @@ -214,7 +215,9 @@ void DefaultState::OnWMEvent(WindowState* window_state, const WMEvent* event) { |
| << "already in pinned mode."; |
|
oshima
2016/09/09 07:18:02
nit: can you update the log message to make it cle
hirono
2016/09/14 00:54:41
Done.
|
| next_state_type = current_state_type; |
| } else { |
| - next_state_type = WINDOW_STATE_TYPE_PINNED; |
| + next_state_type = event->type() == WM_EVENT_PIN |
| + ? WINDOW_STATE_TYPE_PINNED |
| + : WINDOW_STATE_TYPE_TRUSTED_PINNED; |
| } |
| break; |
| case WM_EVENT_TOGGLE_MAXIMIZE_CAPTION: |
| @@ -382,6 +385,7 @@ bool DefaultState::ProcessCompoundEvents(WindowState* window_state, |
| case WM_EVENT_MINIMIZE: |
| case WM_EVENT_FULLSCREEN: |
| case WM_EVENT_PIN: |
| + case WM_EVENT_TRUSTED_PIN: |
| case WM_EVENT_SNAP_LEFT: |
| case WM_EVENT_SNAP_RIGHT: |
| case WM_EVENT_SET_BOUNDS: |
| @@ -493,6 +497,7 @@ bool DefaultState::ProcessWorkspaceEvents(WindowState* window_state, |
| case WM_EVENT_MINIMIZE: |
| case WM_EVENT_FULLSCREEN: |
| case WM_EVENT_PIN: |
| + case WM_EVENT_TRUSTED_PIN: |
| case WM_EVENT_SNAP_LEFT: |
| case WM_EVENT_SNAP_RIGHT: |
| case WM_EVENT_SET_BOUNDS: |
| @@ -586,7 +591,9 @@ void DefaultState::EnterToNextState(WindowState* window_state, |
| window_state->NotifyPostStateTypeChange(previous_state_type); |
| if (next_state_type == WINDOW_STATE_TYPE_PINNED || |
| - previous_state_type == WINDOW_STATE_TYPE_PINNED) { |
| + previous_state_type == WINDOW_STATE_TYPE_PINNED || |
| + next_state_type == WINDOW_STATE_TYPE_TRUSTED_PINNED || |
| + previous_state_type == WINDOW_STATE_TYPE_TRUSTED_PINNED) { |
| WmShell::Get()->SetPinnedWindow(window_state->window()); |
| } |
| } |
| @@ -600,10 +607,12 @@ void DefaultState::ReenterToCurrentState( |
| // pinned since these are "special mode" the user wanted to be in and |
| // should be respected as such. |
| if (previous_state_type == wm::WINDOW_STATE_TYPE_FULLSCREEN || |
| - previous_state_type == wm::WINDOW_STATE_TYPE_PINNED) { |
| + previous_state_type == wm::WINDOW_STATE_TYPE_PINNED || |
| + previous_state_type == wm::WINDOW_STATE_TYPE_TRUSTED_PINNED) { |
| state_type_ = previous_state_type; |
| } else if (state_type_ == wm::WINDOW_STATE_TYPE_FULLSCREEN || |
| - state_type_ == wm::WINDOW_STATE_TYPE_PINNED) { |
| + state_type_ == wm::WINDOW_STATE_TYPE_PINNED || |
| + state_type_ == wm::WINDOW_STATE_TYPE_TRUSTED_PINNED) { |
| state_type_ = previous_state_type; |
| } |
| @@ -683,6 +692,7 @@ void DefaultState::UpdateBoundsFromState(WindowState* window_state, |
| case WINDOW_STATE_TYPE_FULLSCREEN: |
| case WINDOW_STATE_TYPE_PINNED: |
| + case WINDOW_STATE_TYPE_TRUSTED_PINNED: |
| bounds_in_parent = GetDisplayBoundsInParent(window); |
| break; |