Chromium Code Reviews| Index: ash/system/screen_layout_observer.cc |
| diff --git a/ash/system/screen_layout_observer.cc b/ash/system/screen_layout_observer.cc |
| index 0056693d5a9f7f7988d3c985e5e548ea39ae2c03..20cfd42dd6dc08b789f208e7714fe5f8140b646d 100644 |
| --- a/ash/system/screen_layout_observer.cc |
| +++ b/ash/system/screen_layout_observer.cc |
| @@ -20,6 +20,7 @@ |
| #include "ash/system/tray/fixed_sized_image_view.h" |
| #include "ash/system/tray/system_tray_controller.h" |
| #include "ash/system/tray/tray_constants.h" |
| +#include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| #include "base/bind.h" |
| #include "base/strings/string_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| @@ -271,32 +272,43 @@ bool ScreenLayoutObserver::GetDisplayMessageForNotification( |
| GetDisplayName(iter.first), GetDisplaySize(iter.first)); |
| return true; |
| } |
| - // We don't show rotation change notification when the rotation source is |
| - // the accelerometer. |
| - if (iter.second.active_rotation_source() != |
| - display::Display::ROTATION_SOURCE_ACCELEROMETER && |
| - iter.second.GetActiveRotation() != |
| - old_iter->second.GetActiveRotation()) { |
| - int rotation_text_id = 0; |
| - switch (iter.second.GetActiveRotation()) { |
| - case display::Display::ROTATE_0: |
| - rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION; |
| - break; |
| - case display::Display::ROTATE_90: |
| - rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90; |
| - break; |
| - case display::Display::ROTATE_180: |
| - rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180; |
| - break; |
| - case display::Display::ROTATE_270: |
| - rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270; |
| - break; |
| - } |
| - *out_additional_message = l10n_util::GetStringFUTF16( |
| - IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetDisplayName(iter.first), |
| - l10n_util::GetStringUTF16(rotation_text_id)); |
| - return true; |
| + if (iter.second.GetActiveRotation() == old_iter->second.GetActiveRotation()) |
| + continue; |
| + |
| + // We don't show rotation change notification if |
| + // a) the source is accelerometer. |
| + // b) if the device is in tablet mode, and source is not user. |
|
Mr4D (OOO till 08-26)
2017/05/10 04:37:48
You might want to move this comment to line 275 an
oshima
2017/05/10 04:59:23
Done
|
| + if (iter.second.active_rotation_source() == |
| + display::Display::ROTATION_SOURCE_ACCELEROMETER) { |
| + continue; |
| + } |
| + if (Shell::Get() |
| + ->maximize_mode_controller() |
| + ->IsMaximizeModeWindowManagerEnabled() && |
| + iter.second.active_rotation_source() != |
| + display::Display::ROTATION_SOURCE_USER) { |
| + continue; |
| + } |
| + |
| + int rotation_text_id = 0; |
| + switch (iter.second.GetActiveRotation()) { |
| + case display::Display::ROTATE_0: |
| + rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_STANDARD_ORIENTATION; |
| + break; |
| + case display::Display::ROTATE_90: |
| + rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_90; |
| + break; |
| + case display::Display::ROTATE_180: |
| + rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_180; |
| + break; |
| + case display::Display::ROTATE_270: |
| + rotation_text_id = IDS_ASH_STATUS_TRAY_DISPLAY_ORIENTATION_270; |
| + break; |
| } |
| + *out_additional_message = l10n_util::GetStringFUTF16( |
| + IDS_ASH_STATUS_TRAY_DISPLAY_ROTATED, GetDisplayName(iter.first), |
| + l10n_util::GetStringUTF16(rotation_text_id)); |
| + return true; |
| } |
| // Found nothing special |