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

Side by Side Diff: chrome/browser/chromeos/login/helper.cc

Issue 11030017: Add context to gfx::Screen calls in support of simultaneous desktop+ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some new gfx::Screen additions Created 8 years, 2 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 | Annotate | Revision Log
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 "chrome/browser/chromeos/login/helper.h" 5 #include "chrome/browser/chromeos/login/helper.h"
6 6
7 #include "ash/shell.h"
7 #include "base/command_line.h" 8 #include "base/command_line.h"
8 #include "base/file_util.h" 9 #include "base/file_util.h"
9 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/cros/network_library.h" 11 #include "chrome/browser/chromeos/cros/network_library.h"
11 #include "chrome/browser/google/google_util.h" 12 #include "chrome/browser/google/google_util.h"
12 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
13 #include "grit/generated_resources.h" 14 #include "grit/generated_resources.h"
14 #include "grit/theme_resources.h" 15 #include "grit/theme_resources.h"
15 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/layout.h" 17 #include "ui/base/layout.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 51 }
51 52
52 views::Throbber* CreateDefaultThrobber() { 53 views::Throbber* CreateDefaultThrobber() {
53 views::Throbber* throbber = new views::Throbber(kThrobberFrameMs, false); 54 views::Throbber* throbber = new views::Throbber(kThrobberFrameMs, false);
54 throbber->SetFrames( 55 throbber->SetFrames(
55 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_SPINNER)); 56 ResourceBundle::GetSharedInstance().GetImageSkiaNamed(IDR_SPINNER));
56 return throbber; 57 return throbber;
57 } 58 }
58 59
59 gfx::Rect CalculateScreenBounds(const gfx::Size& size) { 60 gfx::Rect CalculateScreenBounds(const gfx::Size& size) {
60 gfx::Rect bounds(gfx::Screen::GetPrimaryDisplay().bounds()); 61 gfx::Rect bounds(ash::Shell::GetAshScreen()->GetPrimaryDisplay().bounds());
61 if (!size.IsEmpty()) { 62 if (!size.IsEmpty()) {
62 int horizontal_diff = bounds.width() - size.width(); 63 int horizontal_diff = bounds.width() - size.width();
63 int vertical_diff = bounds.height() - size.height(); 64 int vertical_diff = bounds.height() - size.height();
64 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); 65 bounds.Inset(horizontal_diff / 2, vertical_diff / 2);
65 } 66 }
66 return bounds; 67 return bounds;
67 } 68 }
68 69
69 void CorrectLabelFontSize(views::Label* label) { 70 void CorrectLabelFontSize(views::Label* label) {
70 if (label) 71 if (label)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 static const int kBaseUserImageSize = 220; 112 static const int kBaseUserImageSize = 220;
112 float scale_factor = gfx::Display::GetForcedDeviceScaleFactor(); 113 float scale_factor = gfx::Display::GetForcedDeviceScaleFactor();
113 if (scale_factor > 1.0f) 114 if (scale_factor > 1.0f)
114 return static_cast<int>(scale_factor * kBaseUserImageSize); 115 return static_cast<int>(scale_factor * kBaseUserImageSize);
115 // Use maximum supported scale factor. 116 // Use maximum supported scale factor.
116 return kBaseUserImageSize * 117 return kBaseUserImageSize *
117 ui::GetScaleFactorScale(ui::GetSupportedScaleFactors().back()); 118 ui::GetScaleFactorScale(ui::GetSupportedScaleFactors().back());
118 } 119 }
119 120
120 } // namespace chromeos 121 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698