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

Side by Side Diff: ash/mus/window_manager_application.cc

Issue 2411223002: chromeos: Refactor system tray Wi-Fi connect dialog so it works with mash (Closed)
Patch Set: NON_EXPORTED_BASE Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mus/window_manager_application.h" 5 #include "ash/mus/window_manager_application.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/common/mojo_interface_factory.h" 10 #include "ash/common/mojo_interface_factory.h"
(...skipping 12 matching lines...) Expand all
23 #include "services/ui/public/cpp/window.h" 23 #include "services/ui/public/cpp/window.h"
24 #include "services/ui/public/cpp/window_tree_client.h" 24 #include "services/ui/public/cpp/window_tree_client.h"
25 #include "ui/aura/env.h" 25 #include "ui/aura/env.h"
26 #include "ui/events/event.h" 26 #include "ui/events/event.h"
27 #include "ui/message_center/message_center.h" 27 #include "ui/message_center/message_center.h"
28 #include "ui/views/mus/aura_init.h" 28 #include "ui/views/mus/aura_init.h"
29 #include "ui/views/mus/surface_context_factory.h" 29 #include "ui/views/mus/surface_context_factory.h"
30 30
31 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
32 #include "ash/common/system/chromeos/power/power_status.h" 32 #include "ash/common/system/chromeos/power/power_status.h"
33 #include "ash/mus/network_connect_delegate_mus.h"
33 #include "chromeos/audio/cras_audio_handler.h" 34 #include "chromeos/audio/cras_audio_handler.h"
34 #include "chromeos/dbus/dbus_thread_manager.h" 35 #include "chromeos/dbus/dbus_thread_manager.h"
35 #include "chromeos/network/network_handler.h" 36 #include "chromeos/network/network_handler.h"
36 #include "chromeos/system/fake_statistics_provider.h" 37 #include "chromeos/system/fake_statistics_provider.h"
37 #include "device/bluetooth/dbus/bluez_dbus_manager.h" // nogncheck 38 #include "device/bluetooth/dbus/bluez_dbus_manager.h" // nogncheck
38 #include "ui/chromeos/network/network_connect.h" 39 #include "ui/chromeos/network/network_connect.h"
39 #endif 40 #endif
40 41
41 namespace ash { 42 namespace ash {
42 namespace mus { 43 namespace mus {
43 44
44 #if defined(OS_CHROMEOS)
45 // TODO(mash): Replace ui::NetworkConnect::Delegate with a mojo interface on a
46 // NetworkConfig service. http://crbug.com/644355
47 class WindowManagerApplication::StubNetworkConnectDelegate
48 : public ui::NetworkConnect::Delegate {
49 public:
50 StubNetworkConnectDelegate() {}
51 ~StubNetworkConnectDelegate() override {}
52
53 void ShowNetworkConfigure(const std::string& network_id) override {}
54 void ShowNetworkSettingsForGuid(const std::string& network_id) override {}
55 bool ShowEnrollNetwork(const std::string& network_id) override {
56 return false;
57 }
58 void ShowMobileSimDialog() override {}
59 void ShowMobileSetupDialog(const std::string& service_path) override {}
60
61 private:
62 DISALLOW_COPY_AND_ASSIGN(StubNetworkConnectDelegate);
63 };
64 #endif // OS_CHROMEOS
65
66 WindowManagerApplication::WindowManagerApplication() 45 WindowManagerApplication::WindowManagerApplication()
67 : screenlock_state_listener_binding_(this) {} 46 : screenlock_state_listener_binding_(this) {}
68 47
69 WindowManagerApplication::~WindowManagerApplication() { 48 WindowManagerApplication::~WindowManagerApplication() {
70 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy 49 // AcceleratorRegistrarImpl removes an observer in its destructor. Destroy
71 // it early on. 50 // it early on.
72 std::set<AcceleratorRegistrarImpl*> accelerator_registrars( 51 std::set<AcceleratorRegistrarImpl*> accelerator_registrars(
73 accelerator_registrars_); 52 accelerator_registrars_);
74 for (AcceleratorRegistrarImpl* registrar : accelerator_registrars) 53 for (AcceleratorRegistrarImpl* registrar : accelerator_registrars)
75 registrar->Destroy(); 54 registrar->Destroy();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // Must occur after mojo::ApplicationRunner has initialized AtExitManager, but 102 // Must occur after mojo::ApplicationRunner has initialized AtExitManager, but
124 // before WindowManager::Init(). 103 // before WindowManager::Init().
125 chromeos::DBusThreadManager::Initialize( 104 chromeos::DBusThreadManager::Initialize(
126 chromeos::DBusThreadManager::PROCESS_ASH); 105 chromeos::DBusThreadManager::PROCESS_ASH);
127 106
128 // See ChromeBrowserMainPartsChromeos for ordering details. 107 // See ChromeBrowserMainPartsChromeos for ordering details.
129 bluez::BluezDBusManager::Initialize( 108 bluez::BluezDBusManager::Initialize(
130 chromeos::DBusThreadManager::Get()->GetSystemBus(), 109 chromeos::DBusThreadManager::Get()->GetSystemBus(),
131 chromeos::DBusThreadManager::Get()->IsUsingFakes()); 110 chromeos::DBusThreadManager::Get()->IsUsingFakes());
132 chromeos::NetworkHandler::Initialize(); 111 chromeos::NetworkHandler::Initialize();
133 network_connect_delegate_.reset(new StubNetworkConnectDelegate()); 112 network_connect_delegate_.reset(new NetworkConnectDelegateMus());
134 ui::NetworkConnect::Initialize(network_connect_delegate_.get()); 113 ui::NetworkConnect::Initialize(network_connect_delegate_.get());
135 // TODO(jamescook): Initialize real audio handler. 114 // TODO(jamescook): Initialize real audio handler.
136 chromeos::CrasAudioHandler::InitializeForTesting(); 115 chromeos::CrasAudioHandler::InitializeForTesting();
137 PowerStatus::Initialize(); 116 PowerStatus::Initialize();
138 #endif 117 #endif
139 } 118 }
140 119
141 void WindowManagerApplication::ShutdownComponents() { 120 void WindowManagerApplication::ShutdownComponents() {
142 #if defined(OS_CHROMEOS) 121 #if defined(OS_CHROMEOS)
143 PowerStatus::Shutdown(); 122 PowerStatus::Shutdown();
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 base::Bind(&WindowManagerApplication::OnAcceleratorRegistrarDestroyed, 200 base::Bind(&WindowManagerApplication::OnAcceleratorRegistrarDestroyed,
222 base::Unretained(this)))); 201 base::Unretained(this))));
223 } 202 }
224 203
225 void WindowManagerApplication::ScreenlockStateChanged(bool locked) { 204 void WindowManagerApplication::ScreenlockStateChanged(bool locked) {
226 window_manager_->SetScreenLocked(locked); 205 window_manager_->SetScreenLocked(locked);
227 } 206 }
228 207
229 } // namespace mus 208 } // namespace mus
230 } // namespace ash 209 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698