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

Side by Side Diff: ash/wm/shelf_layout_manager.cc

Issue 10823350: Re-factor system tray code controlling launcher visibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | no next file » | 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 "ash/wm/shelf_layout_manager.h" 5 #include "ash/wm/shelf_layout_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/launcher/launcher.h" 9 #include "ash/launcher/launcher.h"
10 #include "ash/screen_ash.h" 10 #include "ash/screen_ash.h"
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 537
538 ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState( 538 ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState(
539 VisibilityState visibility_state) const { 539 VisibilityState visibility_state) const {
540 if (visibility_state != AUTO_HIDE || !launcher_widget()) 540 if (visibility_state != AUTO_HIDE || !launcher_widget())
541 return AUTO_HIDE_HIDDEN; 541 return AUTO_HIDE_HIDDEN;
542 542
543 Shell* shell = Shell::GetInstance(); 543 Shell* shell = Shell::GetInstance();
544 if (shell->GetAppListTargetVisibility()) 544 if (shell->GetAppListTargetVisibility())
545 return AUTO_HIDE_SHOWN; 545 return AUTO_HIDE_SHOWN;
546 546
547 if (shell->system_tray() && shell->system_tray()->should_show_launcher()) 547 if (shell->status_area_widget() &&
548 shell->status_area_widget()->should_show_launcher())
548 return AUTO_HIDE_SHOWN; 549 return AUTO_HIDE_SHOWN;
549 550
550 if (launcher_ && launcher_->IsShowingMenu()) 551 if (launcher_ && launcher_->IsShowingMenu())
551 return AUTO_HIDE_SHOWN; 552 return AUTO_HIDE_SHOWN;
552 553
553 if (launcher_ && launcher_->IsShowingOverflowBubble()) 554 if (launcher_ && launcher_->IsShowingOverflowBubble())
554 return AUTO_HIDE_SHOWN; 555 return AUTO_HIDE_SHOWN;
555 556
556 if (launcher_widget()->IsActive() || status_->IsActive()) 557 if (launcher_widget()->IsActive() || status_->IsActive())
557 return AUTO_HIDE_SHOWN; 558 return AUTO_HIDE_SHOWN;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const { 604 int ShelfLayoutManager::GetWorkAreaSize(const State& state, int size) const {
604 if (state.visibility_state == VISIBLE) 605 if (state.visibility_state == VISIBLE)
605 return size; 606 return size;
606 if (state.visibility_state == AUTO_HIDE) 607 if (state.visibility_state == AUTO_HIDE)
607 return kAutoHideSize; 608 return kAutoHideSize;
608 return 0; 609 return 0;
609 } 610 }
610 611
611 } // namespace internal 612 } // namespace internal
612 } // namespace ash 613 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698