OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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. |
| 4 |
| 5 #include "base/bind.h" |
| 6 #include "content/public/browser/browser_context.h" |
| 7 #include "ui/views/examples/content_client/examples_main.h" |
| 8 #include "ui/views/examples/examples_window_with_content.h" |
| 9 |
| 10 namespace { |
| 11 |
| 12 void ShowWindow(content::BrowserContext* browser_context, |
| 13 gfx::NativeView window_context) { |
| 14 views::examples::ShowExamplesWindowWithContent(views::examples::QUIT_ON_CLOSE, |
| 15 browser_context, |
| 16 window_context); |
| 17 |
| 18 // These lines serve no purpose other than to introduce an explicit content |
| 19 // dependency. If the main executable doesn't have this dependency, the linker |
| 20 // has more flexibility to reorder library dependencies in a shared component |
| 21 // build. On linux, this can cause libc to appear before libcontent in the |
| 22 // dlsym search path, which breaks assumptions made in |
| 23 // sandbox::InitLibcUrandomOverrides(). |
| 24 // TODO(tapted): Remove this atrocity. http://crbug.com/374712 |
| 25 if (!browser_context) { |
| 26 content::BrowserContext::SaveSessionState(NULL); |
| 27 NOTREACHED(); |
| 28 } |
| 29 } |
| 30 |
| 31 } // namespace |
| 32 |
| 33 #if defined(OS_WIN) |
| 34 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { |
| 35 views::examples::ExamplesMainParams params(instance); |
| 36 #else |
| 37 int main(int argc, const char** argv) { |
| 38 views::examples::ExamplesMainParams params(argc, argv); |
| 39 #endif |
| 40 |
| 41 params.set_task(base::Bind(&ShowWindow)); |
| 42 return params.RunMain(); |
| 43 } |
OLD | NEW |