OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/manage_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.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/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // Given |args| from the WebUI, parses value 0 as a FilePath |profile_file_path| | 55 // Given |args| from the WebUI, parses value 0 as a FilePath |profile_file_path| |
56 // and returns true on success. | 56 // and returns true on success. |
57 bool GetProfilePathFromArgs(const ListValue* args, | 57 bool GetProfilePathFromArgs(const ListValue* args, |
58 base::FilePath* profile_file_path) { | 58 base::FilePath* profile_file_path) { |
59 const Value* file_path_value; | 59 const Value* file_path_value; |
60 if (!args->Get(0, &file_path_value)) | 60 if (!args->Get(0, &file_path_value)) |
61 return false; | 61 return false; |
62 return base::GetValueAsFilePath(*file_path_value, profile_file_path); | 62 return base::GetValueAsFilePath(*file_path_value, profile_file_path); |
63 } | 63 } |
64 | 64 |
65 void OnNewDefaultProfileCreated( | |
66 chrome::HostDesktopType desktop_type, | |
67 Profile* profile, | |
68 Profile::CreateStatus status) { | |
69 if (status == Profile::CREATE_STATUS_INITIALIZED) { | |
70 profiles::FindOrCreateNewWindowForProfile( | |
71 profile, | |
72 chrome::startup::IS_PROCESS_STARTUP, | |
73 chrome::startup::IS_FIRST_RUN, | |
74 desktop_type, | |
75 false); | |
76 } | |
77 } | |
78 | |
79 } // namespace | 65 } // namespace |
80 | 66 |
81 ManageProfileHandler::ManageProfileHandler() | 67 ManageProfileHandler::ManageProfileHandler() |
82 : weak_factory_(this) { | 68 : weak_factory_(this) { |
83 } | 69 } |
84 | 70 |
85 ManageProfileHandler::~ManageProfileHandler() { | 71 ManageProfileHandler::~ManageProfileHandler() { |
86 ProfileSyncService* service = | 72 ProfileSyncService* service = |
87 ProfileSyncServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())); | 73 ProfileSyncServiceFactory::GetForProfile(Profile::FromWebUI(web_ui())); |
88 // Sync may be disabled in tests. | 74 // Sync may be disabled in tests. |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 g_browser_process->profile_manager()->profile_shortcut_manager(); | 480 g_browser_process->profile_manager()->profile_shortcut_manager(); |
495 DCHECK(shortcut_manager); | 481 DCHECK(shortcut_manager); |
496 | 482 |
497 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 483 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
498 | 484 |
499 // Update the UI buttons. | 485 // Update the UI buttons. |
500 OnHasProfileShortcuts(false); | 486 OnHasProfileShortcuts(false); |
501 } | 487 } |
502 | 488 |
503 } // namespace options | 489 } // namespace options |
OLD | NEW |