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

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 2885153004: React to primary display change instead of removal (Closed)
Patch Set: Workaround DisplayConfigurationController display switch limiter Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/chromeos/login/ui/login_display_host_impl.h" 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/public/cpp/shell_window_ids.h" 10 #include "ash/public/cpp/shell_window_ids.h"
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 974
975 //////////////////////////////////////////////////////////////////////////////// 975 ////////////////////////////////////////////////////////////////////////////////
976 // LoginDisplayHostImpl, display::DisplayObserver: 976 // LoginDisplayHostImpl, display::DisplayObserver:
977 977
978 void LoginDisplayHostImpl::OnDisplayAdded(const display::Display& new_display) { 978 void LoginDisplayHostImpl::OnDisplayAdded(const display::Display& new_display) {
979 if (GetOobeUI()) 979 if (GetOobeUI())
980 GetOobeUI()->OnDisplayConfigurationChanged(); 980 GetOobeUI()->OnDisplayConfigurationChanged();
981 } 981 }
982 982
983 void LoginDisplayHostImpl::OnDisplayRemoved( 983 void LoginDisplayHostImpl::OnDisplayRemoved(
984 const display::Display& old_display) { 984 const display::Display& old_display) {}
oshima 2017/05/17 16:56:18 you can remove this
985 if (GetOobeUI())
986 GetOobeUI()->OnDisplayConfigurationChanged();
987 }
988 985
989 void LoginDisplayHostImpl::OnDisplayMetricsChanged( 986 void LoginDisplayHostImpl::OnDisplayMetricsChanged(
990 const display::Display& display, 987 const display::Display& display,
991 uint32_t changed_metrics) { 988 uint32_t changed_metrics) {
992 display::Display primary_display = 989 display::Display primary_display =
993 display::Screen::GetScreen()->GetPrimaryDisplay(); 990 display::Screen::GetScreen()->GetPrimaryDisplay();
994 if (display.id() != primary_display.id() || 991 if (display.id() != primary_display.id() ||
995 !(changed_metrics & DISPLAY_METRIC_BOUNDS)) { 992 !(changed_metrics & DISPLAY_METRIC_BOUNDS)) {
996 return; 993 return;
997 } 994 }
998 995
999 if (GetOobeUI()) { 996 if (GetOobeUI()) {
1000 const gfx::Size& size = primary_display.size(); 997 const gfx::Size& size = primary_display.size();
1001 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(), 998 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(),
1002 size.height()); 999 size.height());
1000
1001 if (changed_metrics & DISPLAY_METRIC_PRIMARY)
1002 GetOobeUI()->OnDisplayConfigurationChanged();
1003 } 1003 }
1004 } 1004 }
1005 1005
1006 //////////////////////////////////////////////////////////////////////////////// 1006 ////////////////////////////////////////////////////////////////////////////////
1007 // LoginDisplayHostImpl, views::WidgetRemovalsObserver: 1007 // LoginDisplayHostImpl, views::WidgetRemovalsObserver:
1008 void LoginDisplayHostImpl::OnWillRemoveView(views::Widget* widget, 1008 void LoginDisplayHostImpl::OnWillRemoveView(views::Widget* widget,
1009 views::View* view) { 1009 views::View* view) {
1010 if (view != static_cast<views::View*>(login_view_)) 1010 if (view != static_cast<views::View*>(login_view_))
1011 return; 1011 return;
1012 login_view_ = nullptr; 1012 login_view_ = nullptr;
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 // Chrome locale. Otherwise it will be lost if Chrome restarts. 1395 // Chrome locale. Otherwise it will be lost if Chrome restarts.
1396 // Don't need to schedule pref save because setting initial local 1396 // Don't need to schedule pref save because setting initial local
1397 // will enforce preference saving. 1397 // will enforce preference saving.
1398 prefs->SetString(prefs::kApplicationLocale, locale); 1398 prefs->SetString(prefs::kApplicationLocale, locale);
1399 StartupUtils::SetInitialLocale(locale); 1399 StartupUtils::SetInitialLocale(locale);
1400 1400
1401 TriggerShowLoginWizardFinish(locale, std::move(data)); 1401 TriggerShowLoginWizardFinish(locale, std::move(data));
1402 } 1402 }
1403 1403
1404 } // namespace chromeos 1404 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698