| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/signin/user_manager_screen_handler.h" | 5 #include "chrome/browser/ui/webui/signin/user_manager_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 "logRemoveUserWarningShown"; | 84 "logRemoveUserWarningShown"; |
| 85 | 85 |
| 86 const size_t kAvatarIconSize = 180; | 86 const size_t kAvatarIconSize = 180; |
| 87 const int kMaxOAuthRetries = 3; | 87 const int kMaxOAuthRetries = 3; |
| 88 | 88 |
| 89 void HandleAndDoNothing(const base::ListValue* args) { | 89 void HandleAndDoNothing(const base::ListValue* args) { |
| 90 } | 90 } |
| 91 | 91 |
| 92 // This callback is run if the only profile has been deleted, and a new | 92 // This callback is run if the only profile has been deleted, and a new |
| 93 // profile has been created to replace it. | 93 // profile has been created to replace it. |
| 94 void OpenNewWindowForProfile( | 94 void OpenNewWindowForProfile(ui::HostDesktopType desktop_type, |
| 95 chrome::HostDesktopType desktop_type, | 95 Profile* profile, |
| 96 Profile* profile, | 96 Profile::CreateStatus status) { |
| 97 Profile::CreateStatus status) { | |
| 98 if (status != Profile::CREATE_STATUS_INITIALIZED) | 97 if (status != Profile::CREATE_STATUS_INITIALIZED) |
| 99 return; | 98 return; |
| 100 profiles::FindOrCreateNewWindowForProfile( | 99 profiles::FindOrCreateNewWindowForProfile( |
| 101 profile, | 100 profile, |
| 102 chrome::startup::IS_PROCESS_STARTUP, | 101 chrome::startup::IS_PROCESS_STARTUP, |
| 103 chrome::startup::IS_FIRST_RUN, | 102 chrome::startup::IS_FIRST_RUN, |
| 104 desktop_type, | 103 desktop_type, |
| 105 false); | 104 false); |
| 106 } | 105 } |
| 107 | 106 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 ~UrlHashHelper() override; | 155 ~UrlHashHelper() override; |
| 157 | 156 |
| 158 void ExecuteUrlHash(); | 157 void ExecuteUrlHash(); |
| 159 | 158 |
| 160 // chrome::BrowserListObserver overrides: | 159 // chrome::BrowserListObserver overrides: |
| 161 void OnBrowserRemoved(Browser* browser) override; | 160 void OnBrowserRemoved(Browser* browser) override; |
| 162 | 161 |
| 163 private: | 162 private: |
| 164 Browser* browser_; | 163 Browser* browser_; |
| 165 Profile* profile_; | 164 Profile* profile_; |
| 166 chrome::HostDesktopType desktop_type_; | 165 ui::HostDesktopType desktop_type_; |
| 167 std::string hash_; | 166 std::string hash_; |
| 168 | 167 |
| 169 DISALLOW_COPY_AND_ASSIGN(UrlHashHelper); | 168 DISALLOW_COPY_AND_ASSIGN(UrlHashHelper); |
| 170 }; | 169 }; |
| 171 | 170 |
| 172 UrlHashHelper::UrlHashHelper(Browser* browser, const std::string& hash) | 171 UrlHashHelper::UrlHashHelper(Browser* browser, const std::string& hash) |
| 173 : browser_(browser), | 172 : browser_(browser), |
| 174 profile_(browser->profile()), | 173 profile_(browser->profile()), |
| 175 desktop_type_(browser->host_desktop_type()), | 174 desktop_type_(browser->host_desktop_type()), |
| 176 hash_(hash) { | 175 hash_(hash) { |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 Profile* profile, Profile::CreateStatus profile_create_status) { | 858 Profile* profile, Profile::CreateStatus profile_create_status) { |
| 860 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); | 859 Browser* browser = chrome::FindAnyBrowser(profile, false, desktop_type_); |
| 861 if (browser && browser->window()) { | 860 if (browser && browser->window()) { |
| 862 OnBrowserWindowReady(browser); | 861 OnBrowserWindowReady(browser); |
| 863 } else { | 862 } else { |
| 864 registrar_.Add(this, | 863 registrar_.Add(this, |
| 865 chrome::NOTIFICATION_BROWSER_WINDOW_READY, | 864 chrome::NOTIFICATION_BROWSER_WINDOW_READY, |
| 866 content::NotificationService::AllSources()); | 865 content::NotificationService::AllSources()); |
| 867 } | 866 } |
| 868 } | 867 } |
| OLD | NEW |