OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
10 #include "ash/system/bluetooth/bluetooth_observer.h" | 10 #include "ash/system/bluetooth/bluetooth_observer.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
411 virtual void ChangeProxySettings() OVERRIDE { | 411 virtual void ChangeProxySettings() OVERRIDE { |
412 CHECK(GetUserLoginStatus() == ash::user::LOGGED_IN_NONE); | 412 CHECK(GetUserLoginStatus() == ash::user::LOGGED_IN_NONE); |
413 BaseLoginDisplayHost::default_host()->OpenProxySettings(); | 413 BaseLoginDisplayHost::default_host()->OpenProxySettings(); |
414 } | 414 } |
415 | 415 |
416 private: | 416 private: |
417 // Returns the last active browser. If there is no such browser, creates a new | 417 // Returns the last active browser. If there is no such browser, creates a new |
418 // browser window with an empty tab and returns it. | 418 // browser window with an empty tab and returns it. |
419 Browser* GetAppropriateBrowser() { | 419 Browser* GetAppropriateBrowser() { |
420 Browser* browser = BrowserList::GetLastActive(); | 420 Browser* browser = BrowserList::GetLastActive(); |
421 if (!browser) | 421 if (!browser) { |
422 browser = Browser::NewEmptyWindow(ProfileManager::GetDefaultProfile()); | 422 Profile* profile = ProfileManager::GetDefaultProfile(); |
423 browser = Browser::OpenEmptyWindow(profile->GetOriginalProfile()); | |
sky
2012/03/22 00:40:09
I think this is the wrong thing when not signed in
sadrul
2012/03/22 00:46:40
Ah, good point. I'll wait for that CL to land.
| |
424 } | |
423 return browser; | 425 return browser; |
424 } | 426 } |
425 | 427 |
426 void SetProfile(Profile* profile) { | 428 void SetProfile(Profile* profile) { |
427 pref_registrar_.reset(new PrefChangeRegistrar); | 429 pref_registrar_.reset(new PrefChangeRegistrar); |
428 pref_registrar_->Init(profile->GetPrefs()); | 430 pref_registrar_->Init(profile->GetPrefs()); |
429 pref_registrar_->Add(prefs::kUse24HourClock, this); | 431 pref_registrar_->Add(prefs::kUse24HourClock, this); |
430 UpdateClockType(profile->GetPrefs()); | 432 UpdateClockType(profile->GetPrefs()); |
431 } | 433 } |
432 | 434 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
712 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 714 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
713 }; | 715 }; |
714 | 716 |
715 } // namespace | 717 } // namespace |
716 | 718 |
717 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 719 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
718 return new chromeos::SystemTrayDelegate(tray); | 720 return new chromeos::SystemTrayDelegate(tray); |
719 } | 721 } |
720 | 722 |
721 } // namespace chromeos | 723 } // namespace chromeos |
OLD | NEW |