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

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

Issue 2886253002: mash: remove more shell/shelf WmWindow usage. (Closed)
Patch Set: Fix WmShelf::ForWindow. Created 3 years, 7 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.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include "ash/multi_profile_uma.h" 7 #include "ash/multi_profile_uma.h"
8 #include "ash/public/cpp/shelf_item.h" 8 #include "ash/public/cpp/shelf_item.h"
9 #include "ash/public/interfaces/constants.mojom.h" 9 #include "ash/public/interfaces/constants.mojom.h"
10 #include "ash/resources/grit/ash_resources.h" 10 #include "ash/resources/grit/ash_resources.h"
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 } 1352 }
1353 1353
1354 /////////////////////////////////////////////////////////////////////////////// 1354 ///////////////////////////////////////////////////////////////////////////////
1355 // ash::WindowTreeHostManager::Observer: 1355 // ash::WindowTreeHostManager::Observer:
1356 1356
1357 void ChromeLauncherController::OnDisplayConfigurationChanged() { 1357 void ChromeLauncherController::OnDisplayConfigurationChanged() {
1358 // In BOTTOM_LOCKED state, ignore the call of SetShelfBehaviorsFromPrefs. 1358 // In BOTTOM_LOCKED state, ignore the call of SetShelfBehaviorsFromPrefs.
1359 // Because it might be called by some operations, like crbug.com/627040 1359 // Because it might be called by some operations, like crbug.com/627040
1360 // rotating screen. 1360 // rotating screen.
1361 ash::WmShelf* shelf = 1361 ash::WmShelf* shelf =
1362 ash::WmShelf::ForWindow(ash::ShellPort::Get()->GetPrimaryRootWindow()); 1362 ash::WmShelf::ForWindow(ash::Shell::GetPrimaryRootWindow());
1363 if (shelf->alignment() != ash::SHELF_ALIGNMENT_BOTTOM_LOCKED) 1363 if (shelf->alignment() != ash::SHELF_ALIGNMENT_BOTTOM_LOCKED)
1364 SetShelfBehaviorsFromPrefs(); 1364 SetShelfBehaviorsFromPrefs();
1365 } 1365 }
1366 1366
1367 /////////////////////////////////////////////////////////////////////////////// 1367 ///////////////////////////////////////////////////////////////////////////////
1368 // AppSyncUIStateObserver: 1368 // AppSyncUIStateObserver:
1369 1369
1370 void ChromeLauncherController::OnAppSyncUIStatusChanged() { 1370 void ChromeLauncherController::OnAppSyncUIStatusChanged() {
1371 // Update the app list button title to reflect the syncing status. 1371 // Update the app list button title to reflect the syncing status.
1372 base::string16 title = l10n_util::GetStringUTF16( 1372 base::string16 title = l10n_util::GetStringUTF16(
1373 app_sync_ui_state_->status() == AppSyncUIState::STATUS_SYNCING 1373 app_sync_ui_state_->status() == AppSyncUIState::STATUS_SYNCING
1374 ? IDS_ASH_SHELF_APP_LIST_LAUNCHER_SYNCING_TITLE 1374 ? IDS_ASH_SHELF_APP_LIST_LAUNCHER_SYNCING_TITLE
1375 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE); 1375 : IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE);
1376 1376
1377 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST); 1377 const int app_list_index = model_->GetItemIndexForType(ash::TYPE_APP_LIST);
1378 DCHECK_GE(app_list_index, 0); 1378 DCHECK_GE(app_list_index, 0);
1379 ash::ShelfItem item = model_->items()[app_list_index]; 1379 ash::ShelfItem item = model_->items()[app_list_index];
1380 if (item.title != title) { 1380 if (item.title != title) {
1381 item.title = title; 1381 item.title = title;
1382 model_->Set(app_list_index, item); 1382 model_->Set(app_list_index, item);
1383 } 1383 }
1384 } 1384 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698