OLD | NEW |
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/net/network_portal_web_dialog.h" | 5 #include "chrome/browser/chromeos/net/network_portal_web_dialog.h" |
6 | 6 |
7 #include "chrome/grit/generated_resources.h" | 7 #include "chrome/grit/generated_resources.h" |
8 #include "components/captive_portal/captive_portal_detector.h" | 8 #include "components/captive_portal/captive_portal_detector.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/ui_base_types.h" | 10 #include "ui/base/ui_base_types.h" |
11 #include "ui/gfx/display.h" | 11 #include "ui/display/display.h" |
| 12 #include "ui/display/screen.h" |
12 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
13 #include "ui/gfx/screen.h" | |
14 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const float kNetworkPortalWebDialogWidthFraction = .8; | 19 const float kNetworkPortalWebDialogWidthFraction = .8; |
20 const float kNetworkPortalWebDialogHeightFraction = .8; | 20 const float kNetworkPortalWebDialogHeightFraction = .8; |
21 | 21 |
22 gfx::Size GetPortalDialogSize() { | 22 gfx::Size GetPortalDialogSize() { |
23 const gfx::Display display = gfx::Screen::GetScreen()->GetPrimaryDisplay(); | 23 const display::Display display = |
| 24 display::Screen::GetScreen()->GetPrimaryDisplay(); |
24 | 25 |
25 gfx::Size display_size = display.size(); | 26 gfx::Size display_size = display.size(); |
26 | 27 |
27 if (display.rotation() == gfx::Display::ROTATE_90 || | 28 if (display.rotation() == display::Display::ROTATE_90 || |
28 display.rotation() == gfx::Display::ROTATE_270) { | 29 display.rotation() == display::Display::ROTATE_270) { |
29 display_size = gfx::Size(display_size.height(), display_size.width()); | 30 display_size = gfx::Size(display_size.height(), display_size.width()); |
30 } | 31 } |
31 | 32 |
32 display_size = | 33 display_size = |
33 gfx::Size(display_size.width() * kNetworkPortalWebDialogWidthFraction, | 34 gfx::Size(display_size.width() * kNetworkPortalWebDialogWidthFraction, |
34 display_size.height() * kNetworkPortalWebDialogHeightFraction); | 35 display_size.height() * kNetworkPortalWebDialogHeightFraction); |
35 | 36 |
36 return display_size; | 37 return display_size; |
37 } | 38 } |
38 | 39 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void NetworkPortalWebDialog::OnCloseContents(content::WebContents* /* source */, | 96 void NetworkPortalWebDialog::OnCloseContents(content::WebContents* /* source */, |
96 bool* out_close_dialog) { | 97 bool* out_close_dialog) { |
97 *out_close_dialog = true; | 98 *out_close_dialog = true; |
98 } | 99 } |
99 | 100 |
100 bool NetworkPortalWebDialog::ShouldShowDialogTitle() const { | 101 bool NetworkPortalWebDialog::ShouldShowDialogTitle() const { |
101 return true; | 102 return true; |
102 } | 103 } |
103 | 104 |
104 } // namespace chromeos | 105 } // namespace chromeos |
OLD | NEW |