1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_APP_METRO_DRIVER_WIN_H_
6 #define CHROME_APP_METRO_DRIVER_WIN_H_
10 // Helper class to manage the metro driver dll. When present in the system,
11 // the main process thread needs to call InitMetro(), normal execution of
12 // chrome initialization will continue on a second thread while the main
13 // thread will be servicing the metro message loop.
16 typedef int (*MainFn
)(HINSTANCE instance
);
19 // returns true if chrome is being launched in metro. If so we should
20 // call RunInMetro(). If not then we should just run chrome as usual.
21 bool in_metro_mode() const { return (NULL
!= init_metro_fn_
); }
23 // Enter the metro main function, which will only return when chrome metro
24 // is closed. Once metro has initialized, the dll creates a new thread
25 // which runs |main_fn|. This method returns when the chrome metro session
26 // is closed by the user.
27 int RunInMetro(HINSTANCE instance
, MainFn main_fn
);
33 #endif // CHROME_APP_METRO_DRIVER_WIN_H_