Add hooks for user actions on "mode" switch

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