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

Side by Side Diff: ash/shell/content/client/shell_browser_main_parts.cc

Issue 2576913002: Use mojo app list interfaces for mash and classic ash. (Closed)
Patch Set: Fix test name. Created 3 years, 12 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
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 "ash/shell/content/client/shell_browser_main_parts.h" 5 #include "ash/shell/content/client/shell_browser_main_parts.h"
6 6
7 #include "ash/common/login_status.h" 7 #include "ash/common/login_status.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/wm_shell.h" 9 #include "ash/common/wm_shell.h"
10 #include "ash/content/shell_content_state.h" 10 #include "ash/content/shell_content_state.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell/content/shell_content_state_impl.h" 12 #include "ash/shell/content/shell_content_state_impl.h"
13 #include "ash/shell/example_app_list_presenter.h"
13 #include "ash/shell/shell_delegate_impl.h" 14 #include "ash/shell/shell_delegate_impl.h"
14 #include "ash/shell/window_watcher.h" 15 #include "ash/shell/window_watcher.h"
15 #include "ash/shell_init_params.h" 16 #include "ash/shell_init_params.h"
16 #include "base/bind.h" 17 #include "base/bind.h"
17 #include "base/command_line.h" 18 #include "base/command_line.h"
18 #include "base/i18n/icu_util.h" 19 #include "base/i18n/icu_util.h"
19 #include "base/message_loop/message_loop.h" 20 #include "base/message_loop/message_loop.h"
20 #include "base/run_loop.h" 21 #include "base/run_loop.h"
21 #include "base/strings/string_number_conversions.h" 22 #include "base/strings/string_number_conversions.h"
22 #include "base/threading/thread.h" 23 #include "base/threading/thread.h"
23 #include "base/threading/thread_restrictions.h" 24 #include "base/threading/thread_restrictions.h"
24 #include "content/public/browser/browser_thread.h" 25 #include "content/public/browser/browser_thread.h"
25 #include "content/public/browser/context_factory.h" 26 #include "content/public/browser/context_factory.h"
26 #include "content/public/common/content_switches.h" 27 #include "content/public/common/content_switches.h"
27 #include "content/shell/browser/shell_browser_context.h" 28 #include "content/shell/browser/shell_browser_context.h"
28 #include "content/shell/browser/shell_net_log.h" 29 #include "content/shell/browser/shell_net_log.h"
29 #include "net/base/net_module.h" 30 #include "net/base/net_module.h"
31 #include "ui/app_list/presenter/app_list.h"
30 #include "ui/aura/env.h" 32 #include "ui/aura/env.h"
31 #include "ui/aura/window.h" 33 #include "ui/aura/window.h"
32 #include "ui/aura/window_tree_host.h" 34 #include "ui/aura/window_tree_host.h"
33 #include "ui/base/material_design/material_design_controller.h" 35 #include "ui/base/material_design/material_design_controller.h"
34 #include "ui/base/ui_base_paths.h" 36 #include "ui/base/ui_base_paths.h"
35 #include "ui/compositor/compositor.h" 37 #include "ui/compositor/compositor.h"
36 #include "ui/display/screen.h" 38 #include "ui/display/screen.h"
37 #include "ui/message_center/message_center.h" 39 #include "ui/message_center/message_center.h"
38 #include "ui/views/test/test_views_delegate.h" 40 #include "ui/views/test/test_views_delegate.h"
39 #include "ui/wm/core/wm_state.h" 41 #include "ui/wm/core/wm_state.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); 141 init_params.blocking_pool = content::BrowserThread::GetBlockingPool();
140 ash::Shell::CreateInstance(init_params); 142 ash::Shell::CreateInstance(init_params);
141 ash::WmShell::Get()->CreateShelf(); 143 ash::WmShell::Get()->CreateShelf();
142 ash::WmShell::Get()->UpdateAfterLoginStatusChange(LoginStatus::USER); 144 ash::WmShell::Get()->UpdateAfterLoginStatusChange(LoginStatus::USER);
143 145
144 window_watcher_.reset(new ash::shell::WindowWatcher); 146 window_watcher_.reset(new ash::shell::WindowWatcher);
145 display::Screen::GetScreen()->AddObserver(window_watcher_.get()); 147 display::Screen::GetScreen()->AddObserver(window_watcher_.get());
146 148
147 ash::shell::InitWindowTypeLauncher(); 149 ash::shell::InitWindowTypeLauncher();
148 150
151 // Initialize the example app list presenter.
152 example_app_list_presenter_ = base::MakeUnique<ExampleAppListPresenter>();
mfomitchev 2016/12/22 03:17:45 Wait, this is executed in production code. If Exam
msw 2016/12/22 16:31:52 This is //ash/shell, which is only used for the as
mfomitchev 2016/12/22 18:27:11 Ah, ok, thanks for the clarification
153 WmShell::Get()->app_list()->SetAppListPresenter(
154 example_app_list_presenter_->CreateInterfacePtrAndBind());
155
149 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show(); 156 ash::Shell::GetPrimaryRootWindow()->GetHost()->Show();
150 } 157 }
151 158
152 void ShellBrowserMainParts::PostMainMessageLoopRun() { 159 void ShellBrowserMainParts::PostMainMessageLoopRun() {
153 display::Screen::GetScreen()->RemoveObserver(window_watcher_.get()); 160 display::Screen::GetScreen()->RemoveObserver(window_watcher_.get());
154 161
155 window_watcher_.reset(); 162 window_watcher_.reset();
156 delegate_ = nullptr; 163 delegate_ = nullptr;
157 ash::Shell::DeleteInstance(); 164 ash::Shell::DeleteInstance();
158 ShellContentState::DestroyInstance(); 165 ShellContentState::DestroyInstance();
(...skipping 14 matching lines...) Expand all
173 browser_context_.reset(); 180 browser_context_.reset();
174 } 181 }
175 182
176 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { 183 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) {
177 base::RunLoop().Run(); 184 base::RunLoop().Run();
178 return true; 185 return true;
179 } 186 }
180 187
181 } // namespace shell 188 } // namespace shell
182 } // namespace ash 189 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698