Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / app / metro_driver_win.h
blobb99a9af1c085e6ea36a705ee4d0af9b3f91df129
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_
8 #include <Windows.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.
14 class MetroDriver {
15 public:
16 typedef int (*MainFn)(HINSTANCE instance);
18 MetroDriver();
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);
29 private:
30 void* init_metro_fn_;
33 #endif // CHROME_APP_METRO_DRIVER_WIN_H_