| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/chromeos/login/camera_detector.h" | 13 #include "chrome/browser/chromeos/login/camera_detector.h" |
| 14 #include "chrome/browser/chromeos/login/default_user_images.h" | 14 #include "chrome/browser/chromeos/login/default_user_images.h" |
| 15 #include "chrome/browser/chromeos/login/user_manager.h" | 15 #include "chrome/browser/chromeos/login/user_manager.h" |
| 16 #include "chrome/browser/chromeos/options/take_photo_dialog.h" | 16 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ui/browser_list.h" | 18 #include "chrome/browser/ui/browser_list.h" |
| 19 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
| 20 #include "chrome/browser/ui/dialog_style.h" | 20 #include "chrome/browser/ui/dialog_style.h" |
| 21 #include "chrome/browser/ui/views/window.h" | 21 #include "chrome/browser/ui/views/window.h" |
| 22 #include "chrome/browser/ui/webui/web_ui_util.h" | 22 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
| 26 #include "content/browser/tab_contents/tab_contents.h" | |
| 27 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 27 #include "content/public/browser/web_contents.h" |
| 28 #include "content/public/common/url_constants.h" | 28 #include "content/public/common/url_constants.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "grit/theme_resources.h" | 30 #include "grit/theme_resources.h" |
| 31 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/views/widget/widget.h" | 34 #include "ui/views/widget/widget.h" |
| 35 | 35 |
| 36 namespace chromeos { | 36 namespace chromeos { |
| 37 | 37 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 CR_DEFINE_STATIC_LOCAL(SelectFileDialog::FileTypeInfo, file_type_info, | 137 CR_DEFINE_STATIC_LOCAL(SelectFileDialog::FileTypeInfo, file_type_info, |
| 138 (GetUserImageFileTypeInfo())); | 138 (GetUserImageFileTypeInfo())); |
| 139 | 139 |
| 140 select_file_dialog_->SelectFile( | 140 select_file_dialog_->SelectFile( |
| 141 SelectFileDialog::SELECT_OPEN_FILE, | 141 SelectFileDialog::SELECT_OPEN_FILE, |
| 142 l10n_util::GetStringUTF16(IDS_DOWNLOAD_TITLE), | 142 l10n_util::GetStringUTF16(IDS_DOWNLOAD_TITLE), |
| 143 downloads_path, | 143 downloads_path, |
| 144 &file_type_info, | 144 &file_type_info, |
| 145 0, | 145 0, |
| 146 FILE_PATH_LITERAL(""), | 146 FILE_PATH_LITERAL(""), |
| 147 web_ui()->tab_contents(), | 147 web_ui()->web_contents(), |
| 148 GetBrowserWindow(), | 148 GetBrowserWindow(), |
| 149 NULL); | 149 NULL); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void ChangePictureOptionsHandler::HandleTakePhoto(const ListValue* args) { | 152 void ChangePictureOptionsHandler::HandleTakePhoto(const ListValue* args) { |
| 153 DCHECK(args && args->empty()); | 153 DCHECK(args && args->empty()); |
| 154 views::Widget* window = browser::CreateViewsWindow( | 154 views::Widget* window = browser::CreateViewsWindow( |
| 155 GetBrowserWindow(), | 155 GetBrowserWindow(), |
| 156 new TakePhotoDialog(this), | 156 new TakePhotoDialog(this), |
| 157 STYLE_GENERIC); | 157 STYLE_GENERIC); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { | 339 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { |
| 340 Browser* browser = | 340 Browser* browser = |
| 341 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui())); | 341 BrowserList::FindBrowserWithProfile(Profile::FromWebUI(web_ui())); |
| 342 if (!browser) | 342 if (!browser) |
| 343 return NULL; | 343 return NULL; |
| 344 return browser->window()->GetNativeHandle(); | 344 return browser->window()->GetNativeHandle(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace chromeos | 347 } // namespace chromeos |
| OLD | NEW |