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/personal_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/personal_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/command_line.h" | |
12 #include "base/path_service.h" | 11 #include "base/path_service.h" |
13 #include "base/stl_util-inl.h" | 12 #include "base/stl_util-inl.h" |
14 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
15 #include "base/time.h" | 14 #include "base/time.h" |
16 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
17 #include "base/values.h" | 16 #include "base/values.h" |
18 #include "build/build_config.h" | 17 #include "build/build_config.h" |
19 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 19 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/sync/profile_sync_service.h" | 20 #include "chrome/browser/sync/profile_sync_service.h" |
(...skipping 19 matching lines...) Expand all Loading... |
41 #include "chrome/browser/chromeos/options/take_photo_dialog.h" | 40 #include "chrome/browser/chromeos/options/take_photo_dialog.h" |
42 #include "chrome/browser/ui/browser_window.h" | 41 #include "chrome/browser/ui/browser_window.h" |
43 #include "chrome/browser/ui/views/window.h" | 42 #include "chrome/browser/ui/views/window.h" |
44 #include "third_party/skia/include/core/SkBitmap.h" | 43 #include "third_party/skia/include/core/SkBitmap.h" |
45 #endif // defined(OS_CHROMEOS) | 44 #endif // defined(OS_CHROMEOS) |
46 #if defined(TOOLKIT_GTK) | 45 #if defined(TOOLKIT_GTK) |
47 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 46 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
48 #endif // defined(TOOLKIT_GTK) | 47 #endif // defined(TOOLKIT_GTK) |
49 | 48 |
50 PersonalOptionsHandler::PersonalOptionsHandler() { | 49 PersonalOptionsHandler::PersonalOptionsHandler() { |
51 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 50 multiprofile_ = ProfileManager::IsMultipleProfilesEnabled(); |
52 multiprofile_ = browser_command_line.HasSwitch(switches::kMultiProfiles); | |
53 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
54 registrar_.Add(this, | 52 registrar_.Add(this, |
55 NotificationType::LOGIN_USER_IMAGE_CHANGED, | 53 NotificationType::LOGIN_USER_IMAGE_CHANGED, |
56 NotificationService::AllSources()); | 54 NotificationService::AllSources()); |
57 #endif | 55 #endif |
58 } | 56 } |
59 | 57 |
60 PersonalOptionsHandler::~PersonalOptionsHandler() { | 58 PersonalOptionsHandler::~PersonalOptionsHandler() { |
61 ProfileSyncService* sync_service = | 59 ProfileSyncService* sync_service = |
62 web_ui_->GetProfile()->GetProfileSyncService(); | 60 web_ui_->GetProfile()->GetProfileSyncService(); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 timestamp)); | 402 timestamp)); |
405 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture", | 403 web_ui_->CallJavascriptFunction("PersonalOptions.setAccountPicture", |
406 image_url); | 404 image_url); |
407 | 405 |
408 StringValue email_value(email); | 406 StringValue email_value(email); |
409 web_ui_->CallJavascriptFunction("AccountsOptions.updateAccountPicture", | 407 web_ui_->CallJavascriptFunction("AccountsOptions.updateAccountPicture", |
410 email_value, image_url); | 408 email_value, image_url); |
411 } | 409 } |
412 } | 410 } |
413 #endif | 411 #endif |
OLD | NEW |