LEFT | RIGHT |
(no file at all) | |
1 /** | 1 /** |
2 * \file close_application.cpp | 2 * \file close_application.cpp |
3 */ | 3 */ |
4 | 4 |
5 #include <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "session.h" | 7 #include "session.h" |
8 #include "property.h" | 8 #include "property.h" |
9 #include "database.h" | 9 #include "database.h" |
10 #include "process.h" | 10 #include "process.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 snapshot.Refresh() ; | 34 snapshot.Refresh() ; |
35 browserCloser.Refresh() ; | 35 browserCloser.Refresh() ; |
36 engineCloser.Refresh() ; | 36 engineCloser.Refresh() ; |
37 } | 37 } |
38 | 38 |
39 bool IsRunning() | 39 bool IsRunning() |
40 { | 40 { |
41 return browserCloser.IsRunning() || engineCloser.IsRunning() ; | 41 return browserCloser.IsRunning() || engineCloser.IsRunning() ; |
42 } | 42 } |
43 | 43 |
44 bool ShutDown() | 44 bool ShutDown(ImmediateSession& session) |
45 { | 45 { |
46 if ( browserCloser.IsRunning() && ! browserCloser.ShutDown() ) | 46 if ( browserCloser.IsRunning() && ! browserCloser.ShutDown(session) ) |
47 { | 47 { |
48 // Assert IE is still running | 48 // Assert IE is still running |
49 // This is after we've tried to shut it down, so we fail | 49 // This is after we've tried to shut it down, so we fail |
50 return false ; | 50 return false ; |
51 } | 51 } |
52 if ( engineCloser.IsRunning() && ! engineCloser.ShutDown() ) | 52 if ( engineCloser.IsRunning() && ! engineCloser.ShutDown(session) ) |
53 { | 53 { |
54 // Assert the engine is still running | 54 // Assert the engine is still running |
55 // This is after IE has shut down itself and after we've tried to shut dow
n the engine. Whatever. | 55 // This is after IE has shut down itself and after we've tried to shut dow
n the engine. Whatever. |
56 return false ; | 56 return false ; |
57 } | 57 } |
58 return true ; | 58 return true ; |
59 } | 59 } |
60 } ; | 60 } ; |
61 | 61 |
62 | 62 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 * We first shut down IE, or at least attempt to. | 365 * We first shut down IE, or at least attempt to. |
366 * | 366 * |
367 * Succeeded -> Goto success | 367 * Succeeded -> Goto success |
368 * Failed && interactive -> | 368 * Failed && interactive -> |
369 * Ask user if they would like to try again | 369 * Ask user if they would like to try again |
370 * Retry -> re-enter this state | 370 * Retry -> re-enter this state |
371 * Cancel -> Goto notKnown | 371 * Cancel -> Goto notKnown |
372 * Failed && not interactive -> Goto abort | 372 * Failed && not interactive -> Goto abort |
373 */ | 373 */ |
374 { | 374 { |
375 » bool ieWasClosed = iec.ShutDown() ; | 375 » bool ieWasClosed = iec.ShutDown(session) ; |
376 if ( iec.IsRunning() ) | 376 if ( iec.IsRunning() ) |
377 { | 377 { |
378 session.Log( "Attempt to shut down IE automatically failed." ) ; | 378 session.Log( "Attempt to shut down IE automatically failed." ) ; |
379 if ( interactive ) | 379 if ( interactive ) |
380 { | 380 { |
381 // Assert Interactive session and IE did not shut down. | 381 // Assert Interactive session and IE did not shut down. |
382 int x = session.WriteMessage(IMB( | 382 int x = session.WriteMessage(IMB( |
383 messageText.Text(L"dialog_automatic_retry"), | 383 messageText.Text(L"dialog_automatic_retry"), |
384 IMB::Box::warning, IMB::ButtonSet::retryCancel, IMB::DefaultButt
on::one | 384 IMB::Box::warning, IMB::ButtonSet::retryCancel, IMB::DefaultButt
on::one |
385 )) ; | 385 )) ; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 return ERROR_INSTALL_FAILURE ; | 441 return ERROR_INSTALL_FAILURE ; |
442 } | 442 } |
443 catch( ... ) | 443 catch( ... ) |
444 { | 444 { |
445 session.LogNoexcept( "terminated by unknown exception" ) ; | 445 session.LogNoexcept( "terminated by unknown exception" ) ; |
446 return ERROR_INSTALL_FAILURE ; | 446 return ERROR_INSTALL_FAILURE ; |
447 } | 447 } |
448 // Should be unreachable. | 448 // Should be unreachable. |
449 return ERROR_INSTALL_FAILURE ; | 449 return ERROR_INSTALL_FAILURE ; |
450 } | 450 } |
LEFT | RIGHT |