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/chromeos/login/user_image_view.h" | 5 #include "chrome/browser/chromeos/login/user_image_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/login/default_images_view.h" | 9 #include "chrome/browser/chromeos/login/default_images_view.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/helper.h" | 11 #include "chrome/browser/chromeos/login/helper.h" |
12 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 12 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
13 #include "chrome/browser/chromeos/login/user_manager.h" | 13 #include "chrome/browser/chromeos/login/user_manager.h" |
14 #include "chrome/browser/policy/profile_policy_connector.h" | 14 #include "chrome/browser/policy/browser_policy_connector.h" |
15 #include "chrome/browser/policy/profile_policy_connector_factory.h" | |
16 #include "chrome/browser/profiles/profile_manager.h" | |
17 #include "grit/generated_resources.h" | 15 #include "grit/generated_resources.h" |
18 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
22 #include "views/background.h" | 20 #include "views/background.h" |
23 #include "views/controls/button/native_button.h" | 21 #include "views/controls/button/native_button.h" |
24 #include "views/controls/label.h" | 22 #include "views/controls/label.h" |
25 #include "views/layout/grid_layout.h" | 23 #include "views/layout/grid_layout.h" |
26 | 24 |
(...skipping 26 matching lines...) Expand all Loading... |
53 kButtonsRow, // Column set for OK button. | 51 kButtonsRow, // Column set for OK button. |
54 }; | 52 }; |
55 | 53 |
56 views::View* CreateSplitter(const SkColor& color) { | 54 views::View* CreateSplitter(const SkColor& color) { |
57 views::View* splitter = new views::View(); | 55 views::View* splitter = new views::View(); |
58 splitter->set_background(views::Background::CreateSolidBackground(color)); | 56 splitter->set_background(views::Background::CreateSolidBackground(color)); |
59 return splitter; | 57 return splitter; |
60 } | 58 } |
61 | 59 |
62 void TriggerPolicyFetch() { | 60 void TriggerPolicyFetch() { |
63 // Notify all the profiles that the system is idle enough now for a policy | 61 // Notify the user policy subsystem that the system is idle enough now for a |
64 // fetch. (The policy fetch will happen after some delay, see implementation.) | 62 // policy fetch. (The policy fetch will happen after some delay, see |
65 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 63 // implementation.) |
66 std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles(); | 64 g_browser_process->browser_policy_connector()-> |
67 std::vector<Profile*>::iterator it; | 65 ScheduleUserServiceInitialization( |
68 for (it = profiles.begin(); it != profiles.end(); ++it) { | 66 kPolicyServiceInitializationDelayMilliseconds); |
69 policy::ProfilePolicyConnectorFactory::GetForProfile(*it)-> | |
70 ScheduleServiceInitialization( | |
71 kPolicyServiceInitializationDelayMilliseconds); | |
72 } | |
73 } | 67 } |
74 | 68 |
75 } // namespace | 69 } // namespace |
76 | 70 |
77 namespace chromeos { | 71 namespace chromeos { |
78 | 72 |
79 UserImageView::UserImageView(Delegate* delegate) | 73 UserImageView::UserImageView(Delegate* delegate) |
80 : title_label_(NULL), | 74 : title_label_(NULL), |
81 default_images_view_(NULL), | 75 default_images_view_(NULL), |
82 take_photo_view_(NULL), | 76 take_photo_view_(NULL), |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 return; | 249 return; |
256 delegate_->StopCamera(); | 250 delegate_->StopCamera(); |
257 ok_button_->SetEnabled(true); | 251 ok_button_->SetEnabled(true); |
258 ok_button_->RequestFocus(); | 252 ok_button_->RequestFocus(); |
259 take_photo_view_->SetImage( | 253 take_photo_view_->SetImage( |
260 ResourceBundle::GetSharedInstance().GetBitmapNamed( | 254 ResourceBundle::GetSharedInstance().GetBitmapNamed( |
261 kDefaultImageResources[image_index])); | 255 kDefaultImageResources[image_index])); |
262 } | 256 } |
263 | 257 |
264 } // namespace chromeos | 258 } // namespace chromeos |
OLD | NEW |