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

Side by Side Diff: ash/system/tray_display.cc

Issue 10905288: Switch primary display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/shell.cc ('k') | ash/test/ash_test_base.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 "ash/system/tray_display.h" 5 #include "ash/system/tray_display.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 9 #include "ash/shell.h"
9 #include "ash/system/tray/system_tray.h" 10 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray/system_tray_delegate.h" 11 #include "ash/system/tray/system_tray_delegate.h"
11 #include "ash/system/tray/tray_constants.h" 12 #include "ash/system/tray/tray_constants.h"
12 #include "ash/system/tray/tray_views.h" 13 #include "ash/system/tray/tray_views.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "grit/ash_resources.h" 15 #include "grit/ash_resources.h"
15 #include "grit/ash_strings.h" 16 #include "grit/ash_strings.h"
16 #include "ui/aura/display_manager.h" 17 #include "ui/aura/display_manager.h"
17 #include "ui/aura/env.h" 18 #include "ui/aura/env.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 79 }
79 return; 80 return;
80 } 81 }
81 case chromeos::STATE_DUAL_PRIMARY_ONLY: 82 case chromeos::STATE_DUAL_PRIMARY_ONLY:
82 case chromeos::STATE_DUAL_SECONDARY_ONLY: { 83 case chromeos::STATE_DUAL_SECONDARY_ONLY: {
83 aura::DisplayManager* display_manager = 84 aura::DisplayManager* display_manager =
84 aura::Env::GetInstance()->display_manager(); 85 aura::Env::GetInstance()->display_manager();
85 if (display_manager->GetNumDisplays() > 1) { 86 if (display_manager->GetNumDisplays() > 1) {
86 label_->SetText(l10n_util::GetStringFUTF16( 87 label_->SetText(l10n_util::GetStringFUTF16(
87 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, 88 IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED,
88 UTF8ToUTF16(display_manager->GetDisplayNameAt(1)))); 89 UTF8ToUTF16(display_manager->GetDisplayNameFor(
90 ScreenAsh::GetSecondaryDisplay()))));
89 SetVisible(true); 91 SetVisible(true);
90 } else { 92 } else {
91 SetVisible(false); 93 SetVisible(false);
92 } 94 }
93 return; 95 return;
94 } 96 }
95 default: 97 default:
96 NOTREACHED(); 98 NOTREACHED();
97 } 99 }
98 #endif // OS_CHROMEOS 100 #endif // OS_CHROMEOS
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 #if defined(OS_CHROMEOS) 162 #if defined(OS_CHROMEOS)
161 void TrayDisplay::OnDisplayModeChanged() { 163 void TrayDisplay::OnDisplayModeChanged() {
162 if (default_) 164 if (default_)
163 default_->Update(); 165 default_->Update();
164 } 166 }
165 #endif 167 #endif
166 168
167 169
168 } // namespace internal 170 } // namespace internal
169 } // namespace ash 171 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698