| 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/ash/launcher/chrome_launcher_controller_per_app.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.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/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 id_to_item_controller_map_[id] = controller; | 319 id_to_item_controller_map_[id] = controller; |
| 320 controller->set_launcher_id(id); | 320 controller->set_launcher_id(id); |
| 321 return id; | 321 return id; |
| 322 } | 322 } |
| 323 | 323 |
| 324 ash::LauncherID ChromeLauncherControllerPerApp::CreateAppLauncherItem( | 324 ash::LauncherID ChromeLauncherControllerPerApp::CreateAppLauncherItem( |
| 325 LauncherItemController* controller, | 325 LauncherItemController* controller, |
| 326 const std::string& app_id, | 326 const std::string& app_id, |
| 327 ash::LauncherItemStatus status) { | 327 ash::LauncherItemStatus status) { |
| 328 CHECK(controller); | 328 CHECK(controller); |
| 329 // Panels are inserted on the left so as not to push all existing panels over. |
| 330 int index = controller->GetLauncherItemType() == ash::TYPE_APP_PANEL ? |
| 331 0 : model_->item_count(); |
| 329 return InsertAppLauncherItem(controller, | 332 return InsertAppLauncherItem(controller, |
| 330 app_id, | 333 app_id, |
| 331 status, | 334 status, |
| 332 model_->item_count(), | 335 index, |
| 333 controller->GetLauncherItemType()); | 336 controller->GetLauncherItemType()); |
| 334 } | 337 } |
| 335 | 338 |
| 336 void ChromeLauncherControllerPerApp::SetItemStatus( | 339 void ChromeLauncherControllerPerApp::SetItemStatus( |
| 337 ash::LauncherID id, | 340 ash::LauncherID id, |
| 338 ash::LauncherItemStatus status) { | 341 ash::LauncherItemStatus status) { |
| 339 int index = model_->ItemIndexByID(id); | 342 int index = model_->ItemIndexByID(id); |
| 340 // Since ordinary browser windows are not registered, we might get a negative | 343 // Since ordinary browser windows are not registered, we might get a negative |
| 341 // index here. | 344 // index here. |
| 342 if (index >= 0) { | 345 if (index >= 0) { |
| (...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 browser_to_close.pop_back(); | 1670 browser_to_close.pop_back(); |
| 1668 } | 1671 } |
| 1669 } | 1672 } |
| 1670 | 1673 |
| 1671 void | 1674 void |
| 1672 ChromeLauncherControllerPerApp::MoveItemWithoutPinnedStateChangeNotification( | 1675 ChromeLauncherControllerPerApp::MoveItemWithoutPinnedStateChangeNotification( |
| 1673 int source_index, int target_index) { | 1676 int source_index, int target_index) { |
| 1674 base::AutoReset<bool> auto_reset(&ignore_persist_pinned_state_change_, true); | 1677 base::AutoReset<bool> auto_reset(&ignore_persist_pinned_state_change_, true); |
| 1675 model_->Move(source_index, target_index); | 1678 model_->Move(source_index, target_index); |
| 1676 } | 1679 } |
| OLD | NEW |