| OLD | NEW |
| 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.h" | 5 #include "ash/shell.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 void Shell::NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window) { | 546 void Shell::NotifyShelfAutoHideBehaviorChanged(aura::Window* root_window) { |
| 547 for (auto& observer : shell_observers_) | 547 for (auto& observer : shell_observers_) |
| 548 observer.OnShelfAutoHideBehaviorChanged(root_window); | 548 observer.OnShelfAutoHideBehaviorChanged(root_window); |
| 549 } | 549 } |
| 550 | 550 |
| 551 // static | 551 // static |
| 552 void Shell::SetIsBrowserProcessWithMash() { | 552 void Shell::SetIsBrowserProcessWithMash() { |
| 553 g_is_browser_process_with_mash = true; | 553 g_is_browser_process_with_mash = true; |
| 554 } | 554 } |
| 555 | 555 |
| 556 void Shell::OnAppListVisibilityChanged(bool visible, |
| 557 aura::Window* root_window) { |
| 558 for (auto& observer : shell_observers_) |
| 559 observer.OnAppListVisibilityChanged(visible, root_window); |
| 560 } |
| 561 |
| 556 //////////////////////////////////////////////////////////////////////////////// | 562 //////////////////////////////////////////////////////////////////////////////// |
| 557 // Shell, private: | 563 // Shell, private: |
| 558 | 564 |
| 559 Shell::Shell(std::unique_ptr<ShellDelegate> shell_delegate, | 565 Shell::Shell(std::unique_ptr<ShellDelegate> shell_delegate, |
| 560 std::unique_ptr<ShellPort> shell_port) | 566 std::unique_ptr<ShellPort> shell_port) |
| 561 : shell_port_(std::move(shell_port)), | 567 : shell_port_(std::move(shell_port)), |
| 562 ash_display_controller_(base::MakeUnique<AshDisplayController>()), | 568 ash_display_controller_(base::MakeUnique<AshDisplayController>()), |
| 563 brightness_control_delegate_( | 569 brightness_control_delegate_( |
| 564 base::MakeUnique<system::BrightnessControllerChromeos>()), | 570 base::MakeUnique<system::BrightnessControllerChromeos>()), |
| 565 cast_config_(base::MakeUnique<CastConfigController>()), | 571 cast_config_(base::MakeUnique<CastConfigController>()), |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 ? kChromeOsBootColor | 912 ? kChromeOsBootColor |
| 907 : 0); | 913 : 0); |
| 908 display_initialized = true; | 914 display_initialized = true; |
| 909 } | 915 } |
| 910 display_color_manager_.reset(new DisplayColorManager( | 916 display_color_manager_.reset(new DisplayColorManager( |
| 911 display_configurator_.get(), init_params.blocking_pool)); | 917 display_configurator_.get(), init_params.blocking_pool)); |
| 912 | 918 |
| 913 if (!display_initialized) | 919 if (!display_initialized) |
| 914 display_manager_->InitDefaultDisplay(); | 920 display_manager_->InitDefaultDisplay(); |
| 915 | 921 |
| 916 // TODO(sky): move this to chrome for mash. http://crbug.com/729824. | 922 if (config == Config::CLASSIC) { |
| 917 if (ShouldEnableSimplifiedDisplayManagement()) | |
| 918 display_manager_->RefreshFontParams(); | 923 display_manager_->RefreshFontParams(); |
| 919 | 924 |
| 920 if (config == Config::CLASSIC) { | |
| 921 aura::Env::GetInstance()->set_context_factory(init_params.context_factory); | 925 aura::Env::GetInstance()->set_context_factory(init_params.context_factory); |
| 922 aura::Env::GetInstance()->set_context_factory_private( | 926 aura::Env::GetInstance()->set_context_factory_private( |
| 923 init_params.context_factory_private); | 927 init_params.context_factory_private); |
| 924 } | 928 } |
| 925 | 929 |
| 926 // The WindowModalityController needs to be at the front of the input event | 930 // The WindowModalityController needs to be at the front of the input event |
| 927 // pretarget handler list to ensure that it processes input events when modal | 931 // pretarget handler list to ensure that it processes input events when modal |
| 928 // windows are active. | 932 // windows are active. |
| 929 window_modality_controller_.reset(new ::wm::WindowModalityController(this)); | 933 window_modality_controller_.reset(new ::wm::WindowModalityController(this)); |
| 930 | 934 |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 void Shell::OnPrefServiceInitialized( | 1278 void Shell::OnPrefServiceInitialized( |
| 1275 std::unique_ptr<::PrefService> pref_service) { | 1279 std::unique_ptr<::PrefService> pref_service) { |
| 1276 if (!instance_) | 1280 if (!instance_) |
| 1277 return; | 1281 return; |
| 1278 // |pref_service_| is null if can't connect to Chrome (as happens when | 1282 // |pref_service_| is null if can't connect to Chrome (as happens when |
| 1279 // running mash outside of chrome --mash and chrome isn't built). | 1283 // running mash outside of chrome --mash and chrome isn't built). |
| 1280 pref_service_ = std::move(pref_service); | 1284 pref_service_ = std::move(pref_service); |
| 1281 } | 1285 } |
| 1282 | 1286 |
| 1283 } // namespace ash | 1287 } // namespace ash |
| OLD | NEW |