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

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

Issue 17673004: Insert panel icons on the left of other panel icons. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add condition to per browser launcher controller as well. Created 7 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698