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

Unified Diff: chrome/browser/chromeos/login/user_image_screen.cc

Issue 2498003: Revert r48735 "Added user image screen for new user login (or old user logging in through" (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: removed grd files from cl Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/user_image_screen.h ('k') | chrome/browser/chromeos/login/user_image_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/user_image_screen.cc
diff --git a/chrome/browser/chromeos/login/user_image_screen.cc b/chrome/browser/chromeos/login/user_image_screen.cc
deleted file mode 100644
index b39bd30b2814fc202f78a82c5bc33944757c65f8..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/user_image_screen.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/login/user_image_screen.h"
-
-#include "base/compiler_specific.h"
-#include "base/time.h"
-#include "chrome/browser/chromeos/login/login_utils.h"
-#include "chrome/browser/chromeos/login/screen_observer.h"
-#include "chrome/browser/chromeos/login/user_image_downloader.h"
-#include "chrome/browser/chromeos/login/user_image_view.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
-
-namespace chromeos {
-
-namespace {
-
-// The resolution of the picture we want to get from the camera.
-const int kFrameWidth = 480;
-const int kFrameHeight = 480;
-
-// Frame rate in milliseconds for video capturing.
-// We want 25 FPS.
-const int kFrameRate = 40;
-
-} // namespace
-
-UserImageScreen::UserImageScreen(WizardScreenDelegate* delegate)
- : ViewScreen<UserImageView>(delegate),
- ALLOW_THIS_IN_INITIALIZER_LIST(camera_(new Camera(this))) {
- if (!camera_->Initialize(kFrameWidth, kFrameHeight))
- camera_.reset();
-}
-
-UserImageScreen::~UserImageScreen() {
-}
-
-void UserImageScreen::Refresh() {
- if (camera_.get())
- camera_->StartCapturing(base::TimeDelta::FromMilliseconds(kFrameRate));
-}
-
-void UserImageScreen::Hide() {
- if (camera_.get())
- camera_->StopCapturing();
- ViewScreen<UserImageView>::Hide();
-}
-
-UserImageView* UserImageScreen::AllocateView() {
- return new UserImageView(this);
-}
-
-void UserImageScreen::OnVideoFrameCaptured(const SkBitmap& frame) {
- if (view())
- view()->UpdateVideoFrame(frame);
-}
-
-void UserImageScreen::OnOK(const SkBitmap& image) {
- UserManager* user_manager = UserManager::Get();
- if (user_manager) {
- // TODO(avayvod): Check that there's logged in user actually.
- const UserManager::User& user = user_manager->logged_in_user();
- user_manager->SaveUserImage(user.email(), image);
- }
- if (delegate())
- delegate()->GetObserver(this)->OnExit(ScreenObserver::USER_IMAGE_SELECTED);
-}
-
-void UserImageScreen::OnCancel() {
- // Download user image from his Google account.
- UserManager* user_manager = UserManager::Get();
- if (user_manager) {
- // TODO(avayvod): Check that there's logged in user actually.
- const UserManager::User& user = user_manager->logged_in_user();
- new UserImageDownloader(user.email(),
- LoginUtils::Get()->GetAuthToken());
- }
- if (delegate())
- delegate()->GetObserver(this)->OnExit(ScreenObserver::USER_IMAGE_SKIPPED);
-}
-
-} // namespace chromeos
-
« no previous file with comments | « chrome/browser/chromeos/login/user_image_screen.h ('k') | chrome/browser/chromeos/login/user_image_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698