A method of controlling an electronic device including a line-of-sight detection unit configured to detect a viewed position of a user, comprising:
- a first controlling step of performing control such that, in a first operation mode, a first function corresponding to a fact that there is gazing is executed in accordance with a state in which a first condition is satisfied in the line-of-sight detection unit;
- and
- a second controlling step of performing control such that, in a second operation mode, a second function corresponding to a fact that there is gazing is executed in accordance with a state in which a second condition is satisfied in the line-of-sight detection unit, wherein
- the first condition is a condition regarding the viewed position representing a fact that the user has been gazing for a first period,
- the second condition is a condition regarding the viewed position representing a fact that the user has been gazing for a second period longer than the first period, and
- the first operation mode is an imaging mode for performing imaging by an imaging unit.