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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: address comments Created 3 years, 10 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 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
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/prefs/pref_service_syncable_util.h" 36 #include "chrome/browser/prefs/pref_service_syncable_util.h"
36 #include "chrome/browser/profiles/profile.h" 37 #include "chrome/browser/profiles/profile.h"
37 #include "chrome/browser/profiles/profile_manager.h" 38 #include "chrome/browser/profiles/profile_manager.h"
38 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 39 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
39 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 40 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
40 #include "chrome/browser/ui/ash/app_sync_ui_state.h" 41 #include "chrome/browser/ui/ash/app_sync_ui_state.h"
41 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 42 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 196
196 app_sync_ui_state_ = AppSyncUIState::Get(profile); 197 app_sync_ui_state_ = AppSyncUIState::Get(profile);
197 if (app_sync_ui_state_) 198 if (app_sync_ui_state_)
198 app_sync_ui_state_->AddObserver(this); 199 app_sync_ui_state_->AddObserver(this);
199 } 200 }
200 201
201 // All profile relevant settings get bound to the current profile. 202 // All profile relevant settings get bound to the current profile.
202 AttachProfile(profile); 203 AttachProfile(profile);
203 model_->AddObserver(this); 204 model_->AddObserver(this);
204 205
205 if (arc::ArcSessionManager::IsAllowedForProfile(this->profile())) 206 if (arc::IsArcAllowedForProfile(this->profile()))
206 arc_deferred_launcher_.reset(new ArcAppDeferredLauncherController(this)); 207 arc_deferred_launcher_.reset(new ArcAppDeferredLauncherController(this));
207 208
208 // In multi profile mode we might have a window manager. We try to create it 209 // In multi profile mode we might have a window manager. We try to create it
209 // here. If the instantiation fails, the manager is not needed. 210 // here. If the instantiation fails, the manager is not needed.
210 chrome::MultiUserWindowManager::CreateInstance(); 211 chrome::MultiUserWindowManager::CreateInstance();
211 212
212 // On Chrome OS using multi profile we want to switch the content of the shelf 213 // On Chrome OS using multi profile we want to switch the content of the shelf
213 // with a user change. Note that for unit tests the instance can be NULL. 214 // with a user change. Note that for unit tests the instance can be NULL.
214 if (chrome::MultiUserWindowManager::GetMultiProfileMode() != 215 if (chrome::MultiUserWindowManager::GetMultiProfileMode() !=
215 chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_OFF) { 216 chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_OFF) {
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 pref_change_registrar_.Add( 800 pref_change_registrar_.Add(
800 prefs::kTouchVirtualKeyboardEnabled, 801 prefs::kTouchVirtualKeyboardEnabled,
801 base::Bind( 802 base::Bind(
802 &ChromeLauncherControllerImpl::SetVirtualKeyboardBehaviorFromPrefs, 803 &ChromeLauncherControllerImpl::SetVirtualKeyboardBehaviorFromPrefs,
803 base::Unretained(this))); 804 base::Unretained(this)));
804 805
805 std::unique_ptr<LauncherAppUpdater> extension_app_updater( 806 std::unique_ptr<LauncherAppUpdater> extension_app_updater(
806 new LauncherExtensionAppUpdater(this, profile())); 807 new LauncherExtensionAppUpdater(this, profile()));
807 app_updaters_.push_back(std::move(extension_app_updater)); 808 app_updaters_.push_back(std::move(extension_app_updater));
808 809
809 if (arc::ArcSessionManager::IsAllowedForProfile(profile())) { 810 if (arc::IsArcAllowedForProfile(profile())) {
810 std::unique_ptr<LauncherAppUpdater> arc_app_updater( 811 std::unique_ptr<LauncherAppUpdater> arc_app_updater(
811 new LauncherArcAppUpdater(this, profile())); 812 new LauncherArcAppUpdater(this, profile()));
812 app_updaters_.push_back(std::move(arc_app_updater)); 813 app_updaters_.push_back(std::move(arc_app_updater));
813 } 814 }
814 815
815 app_list::AppListSyncableService* app_service = 816 app_list::AppListSyncableService* app_service =
816 app_list::AppListSyncableServiceFactory::GetForProfile(profile()); 817 app_list::AppListSyncableServiceFactory::GetForProfile(profile());
817 if (app_service) 818 if (app_service)
818 app_service->AddObserverAndStart(this); 819 app_service->AddObserverAndStart(this);
819 820
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 LauncherItemController* controller = GetLauncherItemController(item.id); 1491 LauncherItemController* controller = GetLauncherItemController(item.id);
1491 if (!controller || controller->image_set_by_controller()) 1492 if (!controller || controller->image_set_by_controller())
1492 continue; 1493 continue;
1493 item.image = image; 1494 item.image = image;
1494 if (arc_deferred_launcher_) 1495 if (arc_deferred_launcher_)
1495 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image); 1496 arc_deferred_launcher_->MaybeApplySpinningEffect(id, &item.image);
1496 model_->Set(index, item); 1497 model_->Set(index, item);
1497 // It's possible we're waiting on more than one item, so don't break. 1498 // It's possible we're waiting on more than one item, so don't break.
1498 } 1499 }
1499 } 1500 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698