| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/command_line.h" | 22 #include "base/command_line.h" |
| 23 #include "base/macros.h" | 23 #include "base/macros.h" |
| 24 #include "base/strings/pattern.h" | 24 #include "base/strings/pattern.h" |
| 25 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
| 26 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| 27 #include "base/threading/thread_task_runner_handle.h" | 27 #include "base/threading/thread_task_runner_handle.h" |
| 28 #include "base/values.h" | 28 #include "base/values.h" |
| 29 #include "build/build_config.h" | 29 #include "build/build_config.h" |
| 30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
| 31 #include "chrome/browser/chrome_notification_types.h" | 31 #include "chrome/browser/chrome_notification_types.h" |
| 32 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 32 #include "chrome/browser/defaults.h" | 33 #include "chrome/browser/defaults.h" |
| 33 #include "chrome/browser/extensions/extension_util.h" | 34 #include "chrome/browser/extensions/extension_util.h" |
| 34 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 35 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| 35 #include "chrome/browser/profiles/profile.h" | 36 #include "chrome/browser/profiles/profile.h" |
| 36 #include "chrome/browser/profiles/profile_manager.h" | 37 #include "chrome/browser/profiles/profile_manager.h" |
| 37 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 38 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 38 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 39 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 39 #include "chrome/browser/ui/ash/app_sync_ui_state.h" | 40 #include "chrome/browser/ui/ash/app_sync_ui_state.h" |
| 40 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" | 41 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 41 #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h
" | 42 #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h
" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 194 |
| 194 app_sync_ui_state_ = AppSyncUIState::Get(profile); | 195 app_sync_ui_state_ = AppSyncUIState::Get(profile); |
| 195 if (app_sync_ui_state_) | 196 if (app_sync_ui_state_) |
| 196 app_sync_ui_state_->AddObserver(this); | 197 app_sync_ui_state_->AddObserver(this); |
| 197 } | 198 } |
| 198 | 199 |
| 199 // All profile relevant settings get bound to the current profile. | 200 // All profile relevant settings get bound to the current profile. |
| 200 AttachProfile(profile); | 201 AttachProfile(profile); |
| 201 model_->AddObserver(this); | 202 model_->AddObserver(this); |
| 202 | 203 |
| 203 if (arc::ArcSessionManager::IsAllowedForProfile(this->profile())) | 204 if (arc::util::IsArcAllowedForProfile(this->profile())) |
| 204 arc_deferred_launcher_.reset(new ArcAppDeferredLauncherController(this)); | 205 arc_deferred_launcher_.reset(new ArcAppDeferredLauncherController(this)); |
| 205 | 206 |
| 206 // In multi profile mode we might have a window manager. We try to create it | 207 // In multi profile mode we might have a window manager. We try to create it |
| 207 // here. If the instantiation fails, the manager is not needed. | 208 // here. If the instantiation fails, the manager is not needed. |
| 208 chrome::MultiUserWindowManager::CreateInstance(); | 209 chrome::MultiUserWindowManager::CreateInstance(); |
| 209 | 210 |
| 210 // On Chrome OS using multi profile we want to switch the content of the shelf | 211 // On Chrome OS using multi profile we want to switch the content of the shelf |
| 211 // with a user change. Note that for unit tests the instance can be NULL. | 212 // with a user change. Note that for unit tests the instance can be NULL. |
| 212 if (chrome::MultiUserWindowManager::GetMultiProfileMode() != | 213 if (chrome::MultiUserWindowManager::GetMultiProfileMode() != |
| 213 chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_OFF) { | 214 chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_OFF) { |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 pref_change_registrar_.Add( | 810 pref_change_registrar_.Add( |
| 810 prefs::kTouchVirtualKeyboardEnabled, | 811 prefs::kTouchVirtualKeyboardEnabled, |
| 811 base::Bind( | 812 base::Bind( |
| 812 &ChromeLauncherControllerImpl::SetVirtualKeyboardBehaviorFromPrefs, | 813 &ChromeLauncherControllerImpl::SetVirtualKeyboardBehaviorFromPrefs, |
| 813 base::Unretained(this))); | 814 base::Unretained(this))); |
| 814 | 815 |
| 815 std::unique_ptr<LauncherAppUpdater> extension_app_updater( | 816 std::unique_ptr<LauncherAppUpdater> extension_app_updater( |
| 816 new LauncherExtensionAppUpdater(this, profile())); | 817 new LauncherExtensionAppUpdater(this, profile())); |
| 817 app_updaters_.push_back(std::move(extension_app_updater)); | 818 app_updaters_.push_back(std::move(extension_app_updater)); |
| 818 | 819 |
| 819 if (arc::ArcSessionManager::IsAllowedForProfile(profile())) { | 820 if (arc::util::IsArcAllowedForProfile(profile())) { |
| 820 std::unique_ptr<LauncherAppUpdater> arc_app_updater( | 821 std::unique_ptr<LauncherAppUpdater> arc_app_updater( |
| 821 new LauncherArcAppUpdater(this, profile())); | 822 new LauncherArcAppUpdater(this, profile())); |
| 822 app_updaters_.push_back(std::move(arc_app_updater)); | 823 app_updaters_.push_back(std::move(arc_app_updater)); |
| 823 } | 824 } |
| 824 | 825 |
| 825 app_list::AppListSyncableService* app_service = | 826 app_list::AppListSyncableService* app_service = |
| 826 app_list::AppListSyncableServiceFactory::GetForProfile(profile()); | 827 app_list::AppListSyncableServiceFactory::GetForProfile(profile()); |
| 827 if (app_service) | 828 if (app_service) |
| 828 app_service->AddObserverAndStart(this); | 829 app_service->AddObserverAndStart(this); |
| 829 } | 830 } |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 LauncherItemController* controller = GetLauncherItemController(item.id); | 1481 LauncherItemController* controller = GetLauncherItemController(item.id); |
| 1481 if (!controller || controller->image_set_by_controller()) | 1482 if (!controller || controller->image_set_by_controller()) |
| 1482 continue; | 1483 continue; |
| 1483 item.image = image; | 1484 item.image = image; |
| 1484 if (arc_deferred_launcher_) | 1485 if (arc_deferred_launcher_) |
| 1485 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); | 1486 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); |
| 1486 model_->Set(index, item); | 1487 model_->Set(index, item); |
| 1487 // It's possible we're waiting on more than one item, so don't break. | 1488 // It's possible we're waiting on more than one item, so don't break. |
| 1488 } | 1489 } |
| 1489 } | 1490 } |
| OLD | NEW |