| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "content/public/browser/browser_context.h" | 6 #include "content/public/browser/browser_context.h" |
| 7 #include "ui/views/examples/examples_window_with_content.h" | 7 #include "ui/views/examples/examples_window_with_content.h" |
| 8 #include "ui/views_content_client/views_content_client.h" | 8 #include "ui/views_content_client/views_content_client.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 11 #include "content/public/app/startup_helper_win.h" | 11 #include "content/public/app/startup_helper_win.h" |
| 12 #include "sandbox/win/src/sandbox_types.h" | 12 #include "sandbox/win/src/sandbox_types.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 void ShowContentExampleWindow(content::BrowserContext* browser_context, | 17 void ShowContentExampleWindow(content::BrowserContext* browser_context, |
| 18 gfx::NativeView window_context) { | 18 gfx::NativeWindow window_context) { |
| 19 views::examples::ShowExamplesWindowWithContent(views::examples::QUIT_ON_CLOSE, | 19 views::examples::ShowExamplesWindowWithContent(views::examples::QUIT_ON_CLOSE, |
| 20 browser_context, | 20 browser_context, |
| 21 window_context); | 21 window_context); |
| 22 | 22 |
| 23 // These lines serve no purpose other than to introduce an explicit content | 23 // These lines serve no purpose other than to introduce an explicit content |
| 24 // dependency. If the main executable doesn't have this dependency, the linker | 24 // dependency. If the main executable doesn't have this dependency, the linker |
| 25 // has more flexibility to reorder library dependencies in a shared component | 25 // has more flexibility to reorder library dependencies in a shared component |
| 26 // build. On linux, this can cause libc to appear before libcontent in the | 26 // build. On linux, this can cause libc to appear before libcontent in the |
| 27 // dlsym search path, which breaks (usually valid) assumptions made in | 27 // dlsym search path, which breaks (usually valid) assumptions made in |
| 28 // sandbox::InitLibcUrandomOverrides(). See http://crbug.com/374712. | 28 // sandbox::InitLibcUrandomOverrides(). See http://crbug.com/374712. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 40 content::InitializeSandboxInfo(&sandbox_info); | 40 content::InitializeSandboxInfo(&sandbox_info); |
| 41 ui::ViewsContentClient views_content_client(instance, &sandbox_info); | 41 ui::ViewsContentClient views_content_client(instance, &sandbox_info); |
| 42 #else | 42 #else |
| 43 int main(int argc, const char** argv) { | 43 int main(int argc, const char** argv) { |
| 44 ui::ViewsContentClient views_content_client(argc, argv); | 44 ui::ViewsContentClient views_content_client(argc, argv); |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 views_content_client.set_task(base::Bind(&ShowContentExampleWindow)); | 47 views_content_client.set_task(base::Bind(&ShowContentExampleWindow)); |
| 48 return views_content_client.RunMain(); | 48 return views_content_client.RunMain(); |
| 49 } | 49 } |
| OLD | NEW |