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

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

Issue 113783003: Fix the Views UI example. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
14 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
15 #include "content/shell/browser/shell_browser_context.h" 15 #include "content/shell/browser/shell_browser_context.h"
16 #include "ui/base/ime/input_method_initializer.h"
16 #include "ui/views/examples/examples_window_with_content.h" 17 #include "ui/views/examples/examples_window_with_content.h"
17 #include "ui/views/focus/accelerator_handler.h" 18 #include "ui/views/focus/accelerator_handler.h"
18 #include "ui/views/test/desktop_test_views_delegate.h" 19 #include "ui/views/test/desktop_test_views_delegate.h"
19 #include "url/gurl.h" 20 #include "url/gurl.h"
20 21
21 #if defined(USE_AURA) 22 #if defined(USE_AURA)
22 #include "ui/aura/env.h" 23 #include "ui/aura/env.h"
23 #include "ui/gfx/screen.h" 24 #include "ui/gfx/screen.h"
24 #include "ui/views/widget/desktop_aura/desktop_screen.h" 25 #include "ui/views/widget/desktop_aura/desktop_screen.h"
25 #include "ui/views/widget/native_widget_aura.h" 26 #include "ui/views/widget/native_widget_aura.h"
(...skipping 10 matching lines...) Expand all
36 namespace examples { 37 namespace examples {
37 38
38 ExamplesBrowserMainParts::ExamplesBrowserMainParts( 39 ExamplesBrowserMainParts::ExamplesBrowserMainParts(
39 const content::MainFunctionParams& parameters) { 40 const content::MainFunctionParams& parameters) {
40 } 41 }
41 42
42 ExamplesBrowserMainParts::~ExamplesBrowserMainParts() { 43 ExamplesBrowserMainParts::~ExamplesBrowserMainParts() {
43 } 44 }
44 45
45 void ExamplesBrowserMainParts::PreMainMessageLoopRun() { 46 void ExamplesBrowserMainParts::PreMainMessageLoopRun() {
47 ui::InitializeInputMethodForTesting();
46 browser_context_.reset(new content::ShellBrowserContext(false, NULL)); 48 browser_context_.reset(new content::ShellBrowserContext(false, NULL));
47 49
48 gfx::NativeView window_context = NULL; 50 gfx::NativeView window_context = NULL;
49 #if defined(OS_CHROMEOS) 51 #if defined(OS_CHROMEOS)
50 gfx::Screen::SetScreenInstance( 52 gfx::Screen::SetScreenInstance(
51 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create()); 53 gfx::SCREEN_TYPE_NATIVE, aura::TestScreen::Create());
52 // Set up basic pieces of views::corewm. 54 // Set up basic pieces of views::corewm.
53 wm_test_helper_.reset(new wm::WMTestHelper(gfx::Size(800, 600))); 55 wm_test_helper_.reset(new wm::WMTestHelper(gfx::Size(800, 600)));
54 // Ensure the X window gets mapped. 56 // Ensure the X window gets mapped.
55 wm_test_helper_->root_window()->host()->Show(); 57 wm_test_helper_->root_window()->host()->Show();
(...skipping 28 matching lines...) Expand all
84 base::RunLoop run_loop(&accelerator_handler); 86 base::RunLoop run_loop(&accelerator_handler);
85 #else 87 #else
86 base::RunLoop run_loop; 88 base::RunLoop run_loop;
87 #endif 89 #endif
88 run_loop.Run(); 90 run_loop.Run();
89 return true; 91 return true;
90 } 92 }
91 93
92 } // namespace examples 94 } // namespace examples
93 } // namespace views 95 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698