Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CHANGE_PICTURE_OPTIONS_HANDLER_ H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CHANGE_PICTURE_OPTIONS_HANDLER_ H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CHANGE_PICTURE_OPTIONS_HANDLER_ H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CHANGE_PICTURE_OPTIONS_HANDLER_ H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/chromeos/options/take_photo_dialog.h" | 9 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
| 10 #include "chrome/browser/ui/shell_dialogs.h" | 10 #include "chrome/browser/ui/shell_dialogs.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 // WebUIMessageHandler implementation. | 35 // WebUIMessageHandler implementation. |
| 36 virtual void RegisterMessages() OVERRIDE; | 36 virtual void RegisterMessages() OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 // Sends list of available default images to the page. | 39 // Sends list of available default images to the page. |
| 40 void SendAvailableImages(); | 40 void SendAvailableImages(); |
| 41 | 41 |
| 42 // Sends current selection to the page. | 42 // Sends current selection to the page. |
| 43 void SendSelectedImage(); | 43 void SendSelectedImage(); |
| 44 | 44 |
| 45 // Sends the profile image to the page. If |should_select| is true, then | |
|
whywhat
2011/11/11 15:40:42
No , before then
Ivan Korotkov
2011/11/11 16:08:00
Done.
| |
| 46 // the profile image element is selected. | |
| 47 void SendProfileImage(const SkBitmap& image, bool should_select); | |
| 48 | |
| 49 // Starts profile image update and shows the last downloaded profile image, | |
| 50 // if any, on the page. Shouldn't be called before |SendProfileImage|. | |
| 51 void UpdateProfileImage(); | |
| 52 | |
| 45 // Starts camera presence check. | 53 // Starts camera presence check. |
| 46 void CheckCameraPresence(); | 54 void CheckCameraPresence(); |
| 47 | 55 |
| 48 // Updates UI with camera presence state. | 56 // Updates UI with camera presence state. |
| 49 void SetCameraPresent(bool present); | 57 void SetCameraPresent(bool present); |
| 50 | 58 |
| 51 // Opens a file selection dialog to choose user image from file. | 59 // Opens a file selection dialog to choose user image from file. |
| 52 void HandleChooseFile(const base::ListValue* args); | 60 void HandleChooseFile(const base::ListValue* args); |
| 53 | 61 |
| 54 // Opens the camera capture dialog. | 62 // Opens the camera capture dialog. |
| 55 void HandleTakePhoto(const base::ListValue* args); | 63 void HandleTakePhoto(const base::ListValue* args); |
| 56 | 64 |
| 57 // Gets the list of available user images and sends it to the page. | 65 // Gets the list of available user images and sends it to the page. |
| 58 void HandleGetAvailableImages(const base::ListValue* args); | 66 void HandleGetAvailableImages(const base::ListValue* args); |
| 59 | 67 |
| 60 // Gets URL of the currently selected image. | 68 // Handles page shown event. |
| 61 void HandleGetSelectedImage(const base::ListValue* args); | 69 void HandleOnPageShown(const base::ListValue* args); |
| 62 | 70 |
| 63 // Selects one of the available images as user's. | 71 // Selects one of the available images as user's. |
| 64 void HandleSelectImage(const base::ListValue* args); | 72 void HandleSelectImage(const base::ListValue* args); |
| 65 | 73 |
| 66 // SelectFileDialog::Delegate implementation. | 74 // SelectFileDialog::Delegate implementation. |
| 67 virtual void FileSelected( | 75 virtual void FileSelected( |
| 68 const FilePath& path, | 76 const FilePath& path, |
| 69 int index, void* params) OVERRIDE; | 77 int index, void* params) OVERRIDE; |
| 70 | 78 |
| 71 // TakePhotoDialog::Delegate implementation. | 79 // TakePhotoDialog::Delegate implementation. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 94 content::NotificationRegistrar registrar_; | 102 content::NotificationRegistrar registrar_; |
| 95 | 103 |
| 96 base::WeakPtrFactory<ChangePictureOptionsHandler> weak_factory_; | 104 base::WeakPtrFactory<ChangePictureOptionsHandler> weak_factory_; |
| 97 | 105 |
| 98 DISALLOW_COPY_AND_ASSIGN(ChangePictureOptionsHandler); | 106 DISALLOW_COPY_AND_ASSIGN(ChangePictureOptionsHandler); |
| 99 }; | 107 }; |
| 100 | 108 |
| 101 } // namespace chromeos | 109 } // namespace chromeos |
| 102 | 110 |
| 103 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CHANGE_PICTURE_OPTIONS_HANDL ER_H_ | 111 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CHROMEOS_CHANGE_PICTURE_OPTIONS_HANDL ER_H_ |
| OLD | NEW |