Add hooks for user actions on "mode" switch

Signed-off-by: Mattias Andrée <maandree@operamail.com>
pull in admended hooks

Signed-off-by: Mattias Andrée <maandree@operamail.com>