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/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/callback.h" | 7 #include "base/callback.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/login/default_user_images.h" | 10 #include "chrome/browser/chromeos/login/default_user_images.h" |
11 #include "chrome/browser/chromeos/login/user_manager.h" | 11 #include "chrome/browser/chromeos/login/user_manager.h" |
12 #include "chrome/browser/chromeos/options/take_photo_dialog.h" | 12 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
| 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser_list.h" | 14 #include "chrome/browser/ui/browser_list.h" |
14 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
15 #include "chrome/browser/ui/views/window.h" | 16 #include "chrome/browser/ui/views/window.h" |
16 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
17 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
18 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
20 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/resource/resource_bundle.h" | 22 #include "ui/base/resource/resource_bundle.h" |
22 #include "views/widget/widget.h" | 23 #include "views/widget/widget.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 DCHECK(user_manager); | 165 DCHECK(user_manager); |
165 | 166 |
166 const UserManager::User& user = user_manager->logged_in_user(); | 167 const UserManager::User& user = user_manager->logged_in_user(); |
167 DCHECK(!user.email().empty()); | 168 DCHECK(!user.email().empty()); |
168 | 169 |
169 user_manager->SetLoggedInUserImage(photo); | 170 user_manager->SetLoggedInUserImage(photo); |
170 user_manager->SaveUserImage(user.email(), photo); | 171 user_manager->SaveUserImage(user.email(), photo); |
171 } | 172 } |
172 | 173 |
173 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { | 174 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { |
174 Browser* browser = BrowserList::FindBrowserWithProfile(web_ui_->GetProfile()); | 175 Browser* browser = |
| 176 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui_)); |
175 if (!browser) | 177 if (!browser) |
176 return NULL; | 178 return NULL; |
177 return browser->window()->GetNativeHandle(); | 179 return browser->window()->GetNativeHandle(); |
178 } | 180 } |
179 | 181 |
180 } // namespace chromeos | 182 } // namespace chromeos |
OLD | NEW |