| 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" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 GetBrowserWindow(), | 110 GetBrowserWindow(), |
| 111 NULL); | 111 NULL); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void ChangePictureOptionsHandler::TakePhoto(const ListValue* args) { | 114 void ChangePictureOptionsHandler::TakePhoto(const ListValue* args) { |
| 115 DCHECK(args && args->empty()); | 115 DCHECK(args && args->empty()); |
| 116 views::Window* window = browser::CreateViewsWindow( | 116 views::Window* window = browser::CreateViewsWindow( |
| 117 GetBrowserWindow(), | 117 GetBrowserWindow(), |
| 118 gfx::Rect(), | 118 gfx::Rect(), |
| 119 new TakePhotoDialog()); | 119 new TakePhotoDialog()); |
| 120 window->SetAlwaysOnTop(true); | 120 window->SetIsAlwaysOnTop(true); |
| 121 window->Show(); | 121 window->Show(); |
| 122 } | 122 } |
| 123 | 123 |
| 124 void ChangePictureOptionsHandler::GetAvailableImages(const ListValue* args) { | 124 void ChangePictureOptionsHandler::GetAvailableImages(const ListValue* args) { |
| 125 DCHECK(args && args->empty()); | 125 DCHECK(args && args->empty()); |
| 126 ListValue image_urls; | 126 ListValue image_urls; |
| 127 for (int i = 0; i < kDefaultImagesCount; ++i) { | 127 for (int i = 0; i < kDefaultImagesCount; ++i) { |
| 128 image_urls.Append(new StringValue(GetDefaultImageUrl(i))); | 128 image_urls.Append(new StringValue(GetDefaultImageUrl(i))); |
| 129 } | 129 } |
| 130 web_ui_->CallJavascriptFunction("ChangePictureOptions.addUserImages", | 130 web_ui_->CallJavascriptFunction("ChangePictureOptions.addUserImages", |
| (...skipping 28 matching lines...) Expand all Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { | 161 gfx::NativeWindow ChangePictureOptionsHandler::GetBrowserWindow() const { |
| 162 Browser* browser = BrowserList::FindBrowserWithProfile(web_ui_->GetProfile()); | 162 Browser* browser = BrowserList::FindBrowserWithProfile(web_ui_->GetProfile()); |
| 163 if (!browser) | 163 if (!browser) |
| 164 return NULL; | 164 return NULL; |
| 165 return browser->window()->GetNativeHandle(); | 165 return browser->window()->GetNativeHandle(); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace chromeos | 168 } // namespace chromeos |
| OLD | NEW |