diff options
author | jackhou <jackhou@chromium.org> | 2015-05-28 17:29:18 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-29 00:29:51 +0000 |
commit | f409bb4d411ba07422ecb6d49be186bda0aa2f5f (patch) | |
tree | b38b65df8193f11b774ecdcaa14481faa0506c3f /chrome/app_shim | |
parent | 0d16f706d9a0d023fa19b8ba8ce56e755f6eb9db (diff) | |
download | chromium_src-f409bb4d411ba07422ecb6d49be186bda0aa2f5f.zip chromium_src-f409bb4d411ba07422ecb6d49be186bda0aa2f5f.tar.gz chromium_src-f409bb4d411ba07422ecb6d49be186bda0aa2f5f.tar.bz2 |
[Mac] AppWindow.show() and focus() should unhide the shim.
Previously, the shim would request attention (bounce in the dock). The
only way to unhide the shim would be for a user to activate it.
This does not work for apps that should become focused due to other
events, e.g. when responding to a notification action.
BUG=489924
Review URL: https://codereview.chromium.org/1157203002
Cr-Commit-Position: refs/heads/master@{#331890}
Diffstat (limited to 'chrome/app_shim')
-rw-r--r-- | chrome/app_shim/chrome_main_app_mode_mac.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm index 7babb4a..ca3d271 100644 --- a/chrome/app_shim/chrome_main_app_mode_mac.mm +++ b/chrome/app_shim/chrome_main_app_mode_mac.mm @@ -128,6 +128,10 @@ class AppShimController : public IPC::Listener { // Hide this app. void OnHide(); + // Set this app to the unhidden state. Happens when an app window shows + // itself. + void OnUnhideWithoutActivation(); + // Requests user attention. void OnRequestUserAttention(); void OnSetUserAttention(apps::AppShimAttentionType attention_type); @@ -282,6 +286,8 @@ bool AppShimController::OnMessageReceived(const IPC::Message& message) { IPC_BEGIN_MESSAGE_MAP(AppShimController, message) IPC_MESSAGE_HANDLER(AppShimMsg_LaunchApp_Done, OnLaunchAppDone) IPC_MESSAGE_HANDLER(AppShimMsg_Hide, OnHide) + IPC_MESSAGE_HANDLER(AppShimMsg_UnhideWithoutActivation, + OnUnhideWithoutActivation) IPC_MESSAGE_HANDLER(AppShimMsg_RequestUserAttention, OnRequestUserAttention) IPC_MESSAGE_HANDLER(AppShimMsg_SetUserAttention, OnSetUserAttention) IPC_MESSAGE_UNHANDLED(handled = false) @@ -311,6 +317,10 @@ void AppShimController::OnHide() { [NSApp hide:nil]; } +void AppShimController::OnUnhideWithoutActivation() { + [NSApp unhideWithoutActivation]; +} + void AppShimController::OnRequestUserAttention() { OnSetUserAttention(apps::APP_SHIM_ATTENTION_INFORMATIONAL); } |