OLD | NEW |
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/screen_layout_observer.h" | 5 #include "ash/system/screen_layout_observer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/display/screen_orientation_controller_chromeos.h" | 11 #include "ash/display/screen_orientation_controller_chromeos.h" |
12 #include "ash/metrics/user_metrics_action.h" | 12 #include "ash/metrics/user_metrics_action.h" |
13 #include "ash/resources/grit/ash_resources.h" | 13 #include "ash/resources/grit/ash_resources.h" |
14 #include "ash/session/session_controller.h" | 14 #include "ash/session/session_controller.h" |
15 #include "ash/shell.h" | 15 #include "ash/shell.h" |
16 #include "ash/shell_port.h" | 16 #include "ash/shell_port.h" |
17 #include "ash/strings/grit/ash_strings.h" | 17 #include "ash/strings/grit/ash_strings.h" |
18 #include "ash/system/devicetype_utils.h" | 18 #include "ash/system/devicetype_utils.h" |
19 #include "ash/system/system_notifier.h" | 19 #include "ash/system/system_notifier.h" |
20 #include "ash/system/tray/system_tray_controller.h" | 20 #include "ash/system/tray/system_tray_controller.h" |
21 #include "ash/system/tray/tray_constants.h" | 21 #include "ash/system/tray/tray_constants.h" |
22 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 22 #include "ash/wm/tablet_mode/tablet_mode_controller.h" |
23 #include "base/bind.h" | 23 #include "base/bind.h" |
24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
28 #include "ui/display/display.h" | 28 #include "ui/display/display.h" |
29 #include "ui/display/manager/display_manager.h" | 29 #include "ui/display/manager/display_manager.h" |
30 #include "ui/display/types/display_constants.h" | 30 #include "ui/display/types/display_constants.h" |
31 #include "ui/message_center/message_center.h" | 31 #include "ui/message_center/message_center.h" |
32 #include "ui/message_center/notification.h" | 32 #include "ui/message_center/notification.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 // a) no rotation change | 275 // a) no rotation change |
276 if (iter.second.GetActiveRotation() == old_iter->second.GetActiveRotation()) | 276 if (iter.second.GetActiveRotation() == old_iter->second.GetActiveRotation()) |
277 continue; | 277 continue; |
278 // b) the source is accelerometer. | 278 // b) the source is accelerometer. |
279 if (iter.second.active_rotation_source() == | 279 if (iter.second.active_rotation_source() == |
280 display::Display::ROTATION_SOURCE_ACCELEROMETER) { | 280 display::Display::ROTATION_SOURCE_ACCELEROMETER) { |
281 continue; | 281 continue; |
282 } | 282 } |
283 // c) if the device is in tablet mode, and source is not user. | 283 // c) if the device is in tablet mode, and source is not user. |
284 if (Shell::Get() | 284 if (Shell::Get() |
285 ->maximize_mode_controller() | 285 ->tablet_mode_controller() |
286 ->IsMaximizeModeWindowManagerEnabled() && | 286 ->IsTabletModeWindowManagerEnabled() && |
287 iter.second.active_rotation_source() != | 287 iter.second.active_rotation_source() != |
288 display::Display::ROTATION_SOURCE_USER) { | 288 display::Display::ROTATION_SOURCE_USER) { |
289 continue; | 289 continue; |
290 } | 290 } |
291 | 291 |
292 int rotation_text_id = 0; | 292 int rotation_text_id = 0; |
293 switch (iter.second.GetActiveRotation()) { | 293 switch (iter.second.GetActiveRotation()) { |
294 case display::Display::ROTATE_0: | 294 case display::Display::ROTATE_0: |
295 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION; | 295 rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION; |
296 break; | 296 break; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 return true; | 405 return true; |
406 | 406 |
407 default: | 407 default: |
408 // Mirror mode was turned off; other messages should be shown e.g. | 408 // Mirror mode was turned off; other messages should be shown e.g. |
409 // extended mode is on, ... etc. | 409 // extended mode is on, ... etc. |
410 return false; | 410 return false; |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 } // namespace ash | 414 } // namespace ash |
OLD | NEW |