| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "chrome/browser/chromeos/cros/network_library.h" | 8 #include "chrome/browser/chromeos/cros/network_library.h" |
| 9 #include "chrome/browser/chromeos/customization_document.h" | 9 #include "chrome/browser/chromeos/customization_document.h" |
| 10 #include "chrome/browser/chromeos/system_access.h" |
| 10 #include "chrome/browser/google/google_util.h" | 11 #include "chrome/browser/google/google_util.h" |
| 11 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 12 #include "grit/generated_resources.h" | 13 #include "grit/generated_resources.h" |
| 13 #include "grit/theme_resources.h" | 14 #include "grit/theme_resources.h" |
| 14 #include "third_party/skia/include/effects/SkGradientShader.h" | 15 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 15 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 16 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 17 #include "ui/gfx/canvas_skia.h" | 18 #include "ui/gfx/canvas_skia.h" |
| 18 #include "views/controls/button/menu_button.h" | 19 #include "views/controls/button/menu_button.h" |
| 19 #include "views/controls/button/native_button.h" | 20 #include "views/controls/button/native_button.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 return string16(); | 221 return string16(); |
| 221 } | 222 } |
| 222 } | 223 } |
| 223 | 224 |
| 224 const chromeos::StartupCustomizationDocument* LoadStartupManifest() { | 225 const chromeos::StartupCustomizationDocument* LoadStartupManifest() { |
| 225 // Loading manifest causes us to do blocking IO on UI thread. | 226 // Loading manifest causes us to do blocking IO on UI thread. |
| 226 // Temporarily allow it until we fix http://crosbug.com/11103 | 227 // Temporarily allow it until we fix http://crosbug.com/11103 |
| 227 base::ThreadRestrictions::ScopedAllowIO allow_io; | 228 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 228 FilePath startup_manifest_path(kStartupCustomizationManifestPath); | 229 FilePath startup_manifest_path(kStartupCustomizationManifestPath); |
| 229 if (file_util::PathExists(startup_manifest_path)) { | 230 if (file_util::PathExists(startup_manifest_path)) { |
| 231 chromeos::SystemAccess* system = chromeos::SystemAccess::GetInstance(); |
| 230 scoped_ptr<chromeos::StartupCustomizationDocument> customization( | 232 scoped_ptr<chromeos::StartupCustomizationDocument> customization( |
| 231 new chromeos::StartupCustomizationDocument()); | 233 new chromeos::StartupCustomizationDocument(system)); |
| 232 bool manifest_loaded = customization->LoadManifestFromFile( | 234 bool manifest_loaded = customization->LoadManifestFromFile( |
| 233 startup_manifest_path); | 235 startup_manifest_path); |
| 234 if (manifest_loaded) { | 236 if (manifest_loaded) { |
| 235 VLOG(1) << "Startup manifest loaded successfully"; | 237 VLOG(1) << "Startup manifest loaded successfully"; |
| 236 return customization.release(); | 238 return customization.release(); |
| 237 } | 239 } |
| 238 LOG(ERROR) << "Error loading startup manifest: " | 240 LOG(ERROR) << "Error loading startup manifest: " |
| 239 << kStartupCustomizationManifestPath; | 241 << kStartupCustomizationManifestPath; |
| 240 } | 242 } |
| 241 | 243 |
| 242 return NULL; | 244 return NULL; |
| 243 } | 245 } |
| 244 | 246 |
| 245 namespace login { | 247 namespace login { |
| 246 | 248 |
| 247 gfx::Size WideButton::GetPreferredSize() { | 249 gfx::Size WideButton::GetPreferredSize() { |
| 248 gfx::Size preferred_size = NativeButton::GetPreferredSize(); | 250 gfx::Size preferred_size = NativeButton::GetPreferredSize(); |
| 249 // Set minimal width. | 251 // Set minimal width. |
| 250 if (preferred_size.width() < kButtonMinWidth) | 252 if (preferred_size.width() < kButtonMinWidth) |
| 251 preferred_size.set_width(kButtonMinWidth); | 253 preferred_size.set_width(kButtonMinWidth); |
| 252 return preferred_size; | 254 return preferred_size; |
| 253 } | 255 } |
| 254 | 256 |
| 255 } // namespace login | 257 } // namespace login |
| 256 | 258 |
| 257 } // namespace chromeos | 259 } // namespace chromeos |
| OLD | NEW |