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 "chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h" |
6 | 6 |
7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 void ChromeLauncherDelegate::UnpinAppsWithID(const std::string& app_id) { | 389 void ChromeLauncherDelegate::UnpinAppsWithID(const std::string& app_id) { |
390 for (IDToItemMap::iterator i = id_to_item_map_.begin(); | 390 for (IDToItemMap::iterator i = id_to_item_map_.begin(); |
391 i != id_to_item_map_.end(); ) { | 391 i != id_to_item_map_.end(); ) { |
392 IDToItemMap::iterator current(i); | 392 IDToItemMap::iterator current(i); |
393 ++i; | 393 ++i; |
394 if (current->second.app_id == app_id && IsPinned(current->first)) | 394 if (current->second.app_id == app_id && IsPinned(current->first)) |
395 Unpin(current->first); | 395 Unpin(current->first); |
396 } | 396 } |
397 } | 397 } |
398 | 398 |
| 399 bool ChromeLauncherDelegate::IsLoggedInAsGuest() { |
| 400 return ProfileManager::GetDefaultProfileOrOffTheRecord()->IsOffTheRecord(); |
| 401 } |
| 402 |
| 403 void ChromeLauncherDelegate::CreateNewIncognitoWindow() { |
| 404 Browser::NewEmptyWindow(GetProfileForNewWindows()->GetOffTheRecordProfile()); |
| 405 } |
| 406 |
399 void ChromeLauncherDelegate::SetAutoHideBehavior( | 407 void ChromeLauncherDelegate::SetAutoHideBehavior( |
400 ash::ShelfAutoHideBehavior behavior) { | 408 ash::ShelfAutoHideBehavior behavior) { |
401 ash::Shell::GetInstance()->SetShelfAutoHideBehavior(behavior); | 409 ash::Shell::GetInstance()->SetShelfAutoHideBehavior(behavior); |
402 const char* value = NULL; | 410 const char* value = NULL; |
403 switch (behavior) { | 411 switch (behavior) { |
404 case ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT: | 412 case ash::SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT: |
405 value = kShelfAutoHideBehaviorDefault; | 413 value = kShelfAutoHideBehaviorDefault; |
406 break; | 414 break; |
407 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: | 415 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: |
408 value = kShelfAutoHideBehaviorAlways; | 416 value = kShelfAutoHideBehaviorAlways; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 while (!pending_pinned_apps_.empty()) { | 582 while (!pending_pinned_apps_.empty()) { |
575 const Item& item = pending_pinned_apps_.front(); | 583 const Item& item = pending_pinned_apps_.front(); |
576 | 584 |
577 if (!app_icon_loader_->IsValidID(item.app_id)) | 585 if (!app_icon_loader_->IsValidID(item.app_id)) |
578 return; | 586 return; |
579 | 587 |
580 PinAppWithID(item.app_id); | 588 PinAppWithID(item.app_id); |
581 pending_pinned_apps_.pop(); | 589 pending_pinned_apps_.pop(); |
582 } | 590 } |
583 } | 591 } |
OLD | NEW |