Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: ui/views/examples/content_client/examples_browser_main_parts.cc

Issue 10824016: views/examples: Pure pedantic change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/examples/content_client/examples_browser_main_parts.h" 5 #include "ui/views/examples/content_client/examples_browser_main_parts.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 14 matching lines...) Expand all
25 #include "ui/aura/single_display_manager.h" 25 #include "ui/aura/single_display_manager.h"
26 #include "ui/gfx/screen.h" 26 #include "ui/gfx/screen.h"
27 #include "ui/views/widget/desktop_native_widget_helper_aura.h" 27 #include "ui/views/widget/desktop_native_widget_helper_aura.h"
28 #include "ui/views/widget/native_widget_aura.h" 28 #include "ui/views/widget/native_widget_aura.h"
29 #endif 29 #endif
30 30
31 namespace views { 31 namespace views {
32 namespace examples { 32 namespace examples {
33 33
34 namespace { 34 namespace {
35 class ExamplesViewsDelegate : public views::TestViewsDelegate { 35
36 class ExamplesViewsDelegate : public TestViewsDelegate {
36 public: 37 public:
37 #if defined(USE_AURA) 38 #if defined(USE_AURA)
38 virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper( 39 virtual NativeWidgetHelperAura* CreateNativeWidgetHelper(
39 views::NativeWidgetAura* native_widget) OVERRIDE { 40 NativeWidgetAura* native_widget) OVERRIDE {
40 return new views::DesktopNativeWidgetHelperAura(native_widget); 41 return new DesktopNativeWidgetHelperAura(native_widget);
41 } 42 }
42 #endif 43 #endif
43 }; 44 };
45
44 } // namespace 46 } // namespace
45 47
46 ExamplesBrowserMainParts::ExamplesBrowserMainParts( 48 ExamplesBrowserMainParts::ExamplesBrowserMainParts(
47 const content::MainFunctionParams& parameters) { 49 const content::MainFunctionParams& parameters) {
48 } 50 }
49 51
50 ExamplesBrowserMainParts::~ExamplesBrowserMainParts() { 52 ExamplesBrowserMainParts::~ExamplesBrowserMainParts() {
51 } 53 }
52 54
53 void ExamplesBrowserMainParts::PreMainMessageLoopRun() { 55 void ExamplesBrowserMainParts::PreMainMessageLoopRun() {
54 browser_context_.reset(new content::ShellBrowserContext); 56 browser_context_.reset(new content::ShellBrowserContext);
55 57
56 #if defined(USE_AURA) 58 #if defined(USE_AURA)
57 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager); 59 aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager);
58 stacking_client_.reset(new aura::DesktopStackingClient); 60 stacking_client_.reset(new aura::DesktopStackingClient);
59 gfx::Screen::SetInstance(aura::CreateDesktopScreen()); 61 gfx::Screen::SetInstance(aura::CreateDesktopScreen());
60 #endif 62 #endif
61 views_delegate_.reset(new ExamplesViewsDelegate); 63 views_delegate_.reset(new ExamplesViewsDelegate);
62 64
63 views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, 65 ShowExamplesWindow(QUIT_ON_CLOSE, browser_context_.get());
64 browser_context_.get());
65 } 66 }
66 67
67 void ExamplesBrowserMainParts::PostMainMessageLoopRun() { 68 void ExamplesBrowserMainParts::PostMainMessageLoopRun() {
68 browser_context_.reset(); 69 browser_context_.reset();
69 views_delegate_.reset(); 70 views_delegate_.reset();
70 #if defined(USE_AURA) 71 #if defined(USE_AURA)
71 stacking_client_.reset(); 72 stacking_client_.reset();
72 aura::Env::DeleteInstance(); 73 aura::Env::DeleteInstance();
73 #endif 74 #endif
74 } 75 }
75 76
76 bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) { 77 bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) {
77 // xxx: Hax here because this kills event handling. 78 // xxx: Hax here because this kills event handling.
78 #if !defined(USE_AURA) 79 #if !defined(USE_AURA)
79 views::AcceleratorHandler accelerator_handler; 80 AcceleratorHandler accelerator_handler;
80 base::RunLoop run_loop(&accelerator_handler); 81 base::RunLoop run_loop(&accelerator_handler);
81 #else 82 #else
82 base::RunLoop run_loop; 83 base::RunLoop run_loop;
83 #endif 84 #endif
84 run_loop.Run(); 85 run_loop.Run();
85 return true; 86 return true;
86 } 87 }
87 88
88 } // namespace examples 89 } // namespace examples
89 } // namespace views 90 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/content_client/examples_browser_main_parts.h ('k') | ui/views/examples/double_split_view_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698