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

Side by Side Diff: ash/display/display_controller.cc

Issue 314733003: Include the display description in the picker on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | 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/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
11 #include "ash/ash_switches.h" 11 #include "ash/ash_switches.h"
12 #include "ash/display/cursor_window_controller.h" 12 #include "ash/display/cursor_window_controller.h"
13 #include "ash/display/display_layout_store.h" 13 #include "ash/display/display_layout_store.h"
14 #include "ash/display/display_manager.h" 14 #include "ash/display/display_manager.h"
15 #include "ash/display/mirror_window_controller.h" 15 #include "ash/display/mirror_window_controller.h"
16 #include "ash/display/root_window_transformers.h" 16 #include "ash/display/root_window_transformers.h"
17 #include "ash/display/virtual_keyboard_window_controller.h" 17 #include "ash/display/virtual_keyboard_window_controller.h"
18 #include "ash/host/ash_window_tree_host.h" 18 #include "ash/host/ash_window_tree_host.h"
19 #include "ash/host/ash_window_tree_host_init_params.h" 19 #include "ash/host/ash_window_tree_host_init_params.h"
20 #include "ash/host/root_window_transformer.h" 20 #include "ash/host/root_window_transformer.h"
21 #include "ash/root_window_controller.h" 21 #include "ash/root_window_controller.h"
22 #include "ash/root_window_settings.h" 22 #include "ash/root_window_settings.h"
23 #include "ash/screen_util.h" 23 #include "ash/screen_util.h"
24 #include "ash/shell.h" 24 #include "ash/shell.h"
25 #include "ash/shell_delegate.h" 25 #include "ash/shell_delegate.h"
26 #include "ash/wm/coordinate_conversion.h" 26 #include "ash/wm/coordinate_conversion.h"
27 #include "base/command_line.h" 27 #include "base/command_line.h"
28 #include "base/strings/stringprintf.h" 28 #include "base/strings/stringprintf.h"
29 #include "base/strings/utf_string_conversions.h"
29 #include "ui/aura/client/capture_client.h" 30 #include "ui/aura/client/capture_client.h"
30 #include "ui/aura/client/focus_client.h" 31 #include "ui/aura/client/focus_client.h"
31 #include "ui/aura/client/screen_position_client.h" 32 #include "ui/aura/client/screen_position_client.h"
32 #include "ui/aura/window.h" 33 #include "ui/aura/window.h"
33 #include "ui/aura/window_event_dispatcher.h" 34 #include "ui/aura/window_event_dispatcher.h"
34 #include "ui/aura/window_property.h" 35 #include "ui/aura/window_property.h"
35 #include "ui/aura/window_tracker.h" 36 #include "ui/aura/window_tracker.h"
36 #include "ui/aura/window_tree_host.h" 37 #include "ui/aura/window_tree_host.h"
37 #include "ui/compositor/compositor.h" 38 #include "ui/compositor/compositor.h"
38 #include "ui/compositor/compositor_vsync_manager.h" 39 #include "ui/compositor/compositor_vsync_manager.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 const AshWindowTreeHostInitParams& init_params) { 718 const AshWindowTreeHostInitParams& init_params) {
718 static int host_count = 0; 719 static int host_count = 0;
719 const DisplayInfo& display_info = 720 const DisplayInfo& display_info =
720 GetDisplayManager()->GetDisplayInfo(display.id()); 721 GetDisplayManager()->GetDisplayInfo(display.id());
721 AshWindowTreeHostInitParams params_with_bounds(init_params); 722 AshWindowTreeHostInitParams params_with_bounds(init_params);
722 params_with_bounds.initial_bounds = display_info.bounds_in_native(); 723 params_with_bounds.initial_bounds = display_info.bounds_in_native();
723 AshWindowTreeHost* ash_host = AshWindowTreeHost::Create(params_with_bounds); 724 AshWindowTreeHost* ash_host = AshWindowTreeHost::Create(params_with_bounds);
724 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost(); 725 aura::WindowTreeHost* host = ash_host->AsWindowTreeHost();
725 726
726 host->window()->SetName(base::StringPrintf("RootWindow-%d", host_count++)); 727 host->window()->SetName(base::StringPrintf("RootWindow-%d", host_count++));
728 host->window()->set_title(base::UTF8ToUTF16(display_info.name()));
727 host->compositor()->SetBackgroundColor(SK_ColorBLACK); 729 host->compositor()->SetBackgroundColor(SK_ColorBLACK);
728 // No need to remove our observer observer because the DisplayController 730 // No need to remove our observer observer because the DisplayController
729 // outlives the host. 731 // outlives the host.
730 host->AddObserver(this); 732 host->AddObserver(this);
731 InitRootWindowSettings(host->window())->display_id = display.id(); 733 InitRootWindowSettings(host->window())->display_id = display.id();
732 host->InitHost(); 734 host->InitHost();
733 735
734 window_tree_hosts_[display.id()] = ash_host; 736 window_tree_hosts_[display.id()] = ash_host;
735 SetDisplayPropertiesOnHost(ash_host, display); 737 SetDisplayPropertiesOnHost(ash_host, display);
736 738
(...skipping 26 matching lines...) Expand all
763 std::string name = 765 std::string name =
764 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; 766 root_windows[i] == primary ? "aura_root_0" : "aura_root_x";
765 gfx::AcceleratedWidget xwindow = 767 gfx::AcceleratedWidget xwindow =
766 root_windows[i]->GetHost()->GetAcceleratedWidget(); 768 root_windows[i]->GetHost()->GetAcceleratedWidget();
767 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); 769 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str());
768 } 770 }
769 #endif 771 #endif
770 } 772 }
771 773
772 } // namespace ash 774 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698