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.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 if (index < 0) | 552 if (index < 0) |
553 return false; | 553 return false; |
554 ash::ShelfItemType type = model_->items()[index].type; | 554 ash::ShelfItemType type = model_->items()[index].type; |
555 return (type == ash::TYPE_APP_SHORTCUT || type == ash::TYPE_BROWSER_SHORTCUT); | 555 return (type == ash::TYPE_APP_SHORTCUT || type == ash::TYPE_BROWSER_SHORTCUT); |
556 } | 556 } |
557 | 557 |
558 void ChromeLauncherController::TogglePinned(ash::ShelfID id) { | 558 void ChromeLauncherController::TogglePinned(ash::ShelfID id) { |
559 if (!HasItemController(id)) | 559 if (!HasItemController(id)) |
560 return; // May happen if item closed with menu open. | 560 return; // May happen if item closed with menu open. |
561 | 561 |
| 562 // Added for temporary test purposes. |
| 563 // TODO(skuhne): Remove this! |
| 564 if (true) { |
| 565 ash::Shell* shell = ash::Shell::GetInstance(); |
| 566 shell->EnableMaximizeModeWindowManager( |
| 567 !shell->IsMaximizeModeWindowManagerEnabled()); |
| 568 return; |
| 569 } |
| 570 |
562 if (IsPinned(id)) | 571 if (IsPinned(id)) |
563 Unpin(id); | 572 Unpin(id); |
564 else | 573 else |
565 Pin(id); | 574 Pin(id); |
566 } | 575 } |
567 | 576 |
568 bool ChromeLauncherController::IsPinnable(ash::ShelfID id) const { | 577 bool ChromeLauncherController::IsPinnable(ash::ShelfID id) const { |
569 int index = model_->ItemIndexByID(id); | 578 int index = model_->ItemIndexByID(id); |
570 if (index == -1) | 579 if (index == -1) |
571 return false; | 580 return false; |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 } | 2067 } |
2059 | 2068 |
2060 void ChromeLauncherController::ReleaseProfile() { | 2069 void ChromeLauncherController::ReleaseProfile() { |
2061 if (app_sync_ui_state_) | 2070 if (app_sync_ui_state_) |
2062 app_sync_ui_state_->RemoveObserver(this); | 2071 app_sync_ui_state_->RemoveObserver(this); |
2063 | 2072 |
2064 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); | 2073 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); |
2065 | 2074 |
2066 pref_change_registrar_.RemoveAll(); | 2075 pref_change_registrar_.RemoveAll(); |
2067 } | 2076 } |
OLD | NEW |