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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2316183003: Move a bunch of ash-only vector icons to ash/. (Closed)
Patch Set: drop the "id". Just "icon". It's cleaner. Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/common/system/chromeos/palette/palette_tray.h" 5 #include "ash/common/system/chromeos/palette/palette_tray.h"
6 6
7 #include "ash/common/shelf/shelf_constants.h" 7 #include "ash/common/shelf/shelf_constants.h"
8 #include "ash/common/shelf/wm_shelf.h" 8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/shelf/wm_shelf_util.h" 9 #include "ash/common/shelf/wm_shelf_util.h"
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 if (IsHorizontalAlignment(shelf_alignment())) { 337 if (IsHorizontalAlignment(shelf_alignment())) {
338 icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets( 338 icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(
339 kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding))); 339 kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding)));
340 } else { 340 } else {
341 icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets( 341 icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(
342 kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding))); 342 kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding)));
343 } 343 }
344 } 344 }
345 345
346 void PaletteTray::UpdateTrayIcon() { 346 void PaletteTray::UpdateTrayIcon() {
347 gfx::VectorIconId icon = palette_tool_manager_->GetActiveTrayIcon( 347 icon_->SetImage(CreateVectorIcon(
348 palette_tool_manager_->GetActiveTool(ash::PaletteGroup::MODE)); 348 palette_tool_manager_->GetActiveTrayIcon(
349 icon_->SetImage(CreateVectorIcon(icon, kShelfIconSize, kShelfIconColor)); 349 palette_tool_manager_->GetActiveTool(ash::PaletteGroup::MODE)),
350 kShelfIconSize, kShelfIconColor));
350 } 351 }
351 352
352 void PaletteTray::OnStylusStateChanged(ui::StylusState stylus_state) { 353 void PaletteTray::OnStylusStateChanged(ui::StylusState stylus_state) {
353 if (!WmShell::Get()->palette_delegate()->ShouldAutoOpenPalette()) 354 if (!WmShell::Get()->palette_delegate()->ShouldAutoOpenPalette())
354 return; 355 return;
355 356
356 if (stylus_state == ui::StylusState::REMOVED && !bubble_) 357 if (stylus_state == ui::StylusState::REMOVED && !bubble_)
357 ShowPalette(); 358 ShowPalette();
358 else if (stylus_state == ui::StylusState::INSERTED && bubble_) 359 else if (stylus_state == ui::StylusState::INSERTED && bubble_)
359 bubble_.reset(); 360 bubble_.reset();
(...skipping 11 matching lines...) Expand all
371 WmShell::Get()->GetSessionStateDelegate(); 372 WmShell::Get()->GetSessionStateDelegate();
372 373
373 SetVisible(!session_state_delegate->IsScreenLocked() && 374 SetVisible(!session_state_delegate->IsScreenLocked() &&
374 session_state_delegate->GetSessionState() == 375 session_state_delegate->GetSessionState() ==
375 SessionStateDelegate::SESSION_STATE_ACTIVE && 376 SessionStateDelegate::SESSION_STATE_ACTIVE &&
376 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != 377 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() !=
377 LoginStatus::KIOSK_APP); 378 LoginStatus::KIOSK_APP);
378 } 379 }
379 380
380 } // namespace ash 381 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698