OLD | NEW |
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/ui/webui/options/chromeos/change_picture_options_handle
r.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/change_picture_options_handle
r.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 OptionsPageUIHandler::Observe(type, source, details); | 394 OptionsPageUIHandler::Observe(type, source, details); |
395 if (type == chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED) { | 395 if (type == chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED) { |
396 // User profile image has been updated. | 396 // User profile image has been updated. |
397 SendProfileImage(*content::Details<const gfx::ImageSkia>(details).ptr(), | 397 SendProfileImage(*content::Details<const gfx::ImageSkia>(details).ptr(), |
398 false); | 398 false); |
399 } | 399 } |
400 } | 400 } |
401 | 401 |
402 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { | 402 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { |
403 Browser* browser = | 403 Browser* browser = |
404 browser::FindBrowserWithWebContents(web_ui()->GetWebContents()); | 404 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); |
405 return browser->window()->GetNativeWindow(); | 405 return browser->window()->GetNativeWindow(); |
406 } | 406 } |
407 | 407 |
408 void ChangePictureOptionsHandler::OnImageDecoded( | 408 void ChangePictureOptionsHandler::OnImageDecoded( |
409 const ImageDecoder* decoder, | 409 const ImageDecoder* decoder, |
410 const SkBitmap& decoded_image) { | 410 const SkBitmap& decoded_image) { |
411 DCHECK_EQ(image_decoder_.get(), decoder); | 411 DCHECK_EQ(image_decoder_.get(), decoder); |
412 image_decoder_ = NULL; | 412 image_decoder_ = NULL; |
413 user_photo_ = gfx::ImageSkia(decoded_image); | 413 user_photo_ = gfx::ImageSkia(decoded_image); |
414 SetImageFromCamera(user_photo_); | 414 SetImageFromCamera(user_photo_); |
415 } | 415 } |
416 | 416 |
417 void ChangePictureOptionsHandler::OnDecodeImageFailed( | 417 void ChangePictureOptionsHandler::OnDecodeImageFailed( |
418 const ImageDecoder* decoder) { | 418 const ImageDecoder* decoder) { |
419 NOTREACHED() << "Failed to decode PNG image from WebUI"; | 419 NOTREACHED() << "Failed to decode PNG image from WebUI"; |
420 } | 420 } |
421 | 421 |
422 } // namespace options | 422 } // namespace options |
423 } // namespace chromeos | 423 } // namespace chromeos |
OLD | NEW |