| 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/profiles/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 : profile_(profile), | 55 : profile_(profile), |
| 56 callback_(callback) { | 56 callback_(callback) { |
| 57 DCHECK(!callback_.is_null()); | 57 DCHECK(!callback_.is_null()); |
| 58 BrowserList::AddObserver(this); | 58 BrowserList::AddObserver(this); |
| 59 } | 59 } |
| 60 virtual ~BrowserAddedForProfileObserver() { | 60 virtual ~BrowserAddedForProfileObserver() { |
| 61 } | 61 } |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 // Overridden from BrowserListObserver: | 64 // Overridden from BrowserListObserver: |
| 65 virtual void OnBrowserAdded(Browser* browser) OVERRIDE { | 65 virtual void OnBrowserAdded(Browser* browser) override { |
| 66 if (browser->profile() == profile_) { | 66 if (browser->profile() == profile_) { |
| 67 BrowserList::RemoveObserver(this); | 67 BrowserList::RemoveObserver(this); |
| 68 callback_.Run(profile_, Profile::CREATE_STATUS_INITIALIZED); | 68 callback_.Run(profile_, Profile::CREATE_STATUS_INITIALIZED); |
| 69 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 69 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 | 72 |
| 73 // Profile for which the browser should be opened. | 73 // Profile for which the browser should be opened. |
| 74 Profile* profile_; | 74 Profile* profile_; |
| 75 ProfileManager::CreateCallback callback_; | 75 ProfileManager::CreateCallback callback_; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: | 420 case BrowserWindow::AVATAR_BUBBLE_MODE_SHOW_ERROR: |
| 421 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 421 *bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 422 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; | 422 *tutorial_mode = TUTORIAL_MODE_SHOW_ERROR; |
| 423 return; | 423 return; |
| 424 default: | 424 default: |
| 425 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; | 425 *bubble_view_mode = profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER; |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace profiles | 429 } // namespace profiles |
| OLD | NEW |