Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check_deps exception to specific_include_rules after chat with Kai. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "chrome/browser/chromeos/system/timezone_settings.h" 54 #include "chrome/browser/chromeos/system/timezone_settings.h"
55 #include "chrome/browser/chromeos/system_key_event_listener.h" 55 #include "chrome/browser/chromeos/system_key_event_listener.h"
56 #include "chrome/browser/google_apis/gdata_util.h" 56 #include "chrome/browser/google_apis/gdata_util.h"
57 #include "chrome/browser/lifetime/application_lifetime.h" 57 #include "chrome/browser/lifetime/application_lifetime.h"
58 #include "chrome/browser/prefs/pref_service.h" 58 #include "chrome/browser/prefs/pref_service.h"
59 #include "chrome/browser/profiles/profile_manager.h" 59 #include "chrome/browser/profiles/profile_manager.h"
60 #include "chrome/browser/ui/ash/volume_controller_chromeos.h" 60 #include "chrome/browser/ui/ash/volume_controller_chromeos.h"
61 #include "chrome/browser/ui/browser.h" 61 #include "chrome/browser/ui/browser.h"
62 #include "chrome/browser/ui/browser_finder.h" 62 #include "chrome/browser/ui/browser_finder.h"
63 #include "chrome/browser/ui/chrome_pages.h" 63 #include "chrome/browser/ui/chrome_pages.h"
64 #include "chrome/browser/ui/host_desktop.h"
64 #include "chrome/browser/ui/singleton_tabs.h" 65 #include "chrome/browser/ui/singleton_tabs.h"
65 #include "chrome/browser/upgrade_detector.h" 66 #include "chrome/browser/upgrade_detector.h"
66 #include "chrome/common/chrome_notification_types.h" 67 #include "chrome/common/chrome_notification_types.h"
67 #include "chrome/common/pref_names.h" 68 #include "chrome/common/pref_names.h"
68 #include "chrome/common/url_constants.h" 69 #include "chrome/common/url_constants.h"
69 #include "chromeos/dbus/dbus_thread_manager.h" 70 #include "chromeos/dbus/dbus_thread_manager.h"
70 #include "chromeos/dbus/power_manager_client.h" 71 #include "chromeos/dbus/power_manager_client.h"
71 #include "chromeos/dbus/session_manager_client.h" 72 #include "chromeos/dbus/session_manager_client.h"
72 #include "content/public/browser/browser_thread.h" 73 #include "content/public/browser/browser_thread.h"
73 #include "content/public/browser/notification_observer.h" 74 #include "content/public/browser/notification_observer.h"
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 697
697 virtual void SetVolumeControlDelegate( 698 virtual void SetVolumeControlDelegate(
698 scoped_ptr<ash::VolumeControlDelegate> delegate) OVERRIDE { 699 scoped_ptr<ash::VolumeControlDelegate> delegate) OVERRIDE {
699 volume_control_delegate_.swap(delegate); 700 volume_control_delegate_.swap(delegate);
700 } 701 }
701 private: 702 private:
702 // Returns the last active browser. If there is no such browser, creates a new 703 // Returns the last active browser. If there is no such browser, creates a new
703 // browser window with an empty tab and returns it. 704 // browser window with an empty tab and returns it.
704 Browser* GetAppropriateBrowser() { 705 Browser* GetAppropriateBrowser() {
705 return browser::FindOrCreateTabbedBrowser( 706 return browser::FindOrCreateTabbedBrowser(
706 ProfileManager::GetDefaultProfileOrOffTheRecord()); 707 ProfileManager::GetDefaultProfileOrOffTheRecord(),
708 chrome::HOST_DESKTOP_TYPE_ASH);
707 } 709 }
708 710
709 void SetProfile(Profile* profile) { 711 void SetProfile(Profile* profile) {
710 pref_registrar_.reset(new PrefChangeRegistrar); 712 pref_registrar_.reset(new PrefChangeRegistrar);
711 pref_registrar_->Init(profile->GetPrefs()); 713 pref_registrar_->Init(profile->GetPrefs());
712 pref_registrar_->Add(prefs::kUse24HourClock, this); 714 pref_registrar_->Add(prefs::kUse24HourClock, this);
713 pref_registrar_->Add(prefs::kLanguageXkbRemapSearchKeyTo, this); 715 pref_registrar_->Add(prefs::kLanguageXkbRemapSearchKeyTo, this);
714 UpdateClockType(profile->GetPrefs()); 716 UpdateClockType(profile->GetPrefs());
715 search_key_mapped_to_ = 717 search_key_mapped_to_ =
716 profile->GetPrefs()->GetInteger(prefs::kLanguageXkbRemapSearchKeyTo); 718 profile->GetPrefs()->GetInteger(prefs::kLanguageXkbRemapSearchKeyTo);
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); 1262 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate);
1261 }; 1263 };
1262 1264
1263 } // namespace 1265 } // namespace
1264 1266
1265 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { 1267 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) {
1266 return new chromeos::SystemTrayDelegate(tray); 1268 return new chromeos::SystemTrayDelegate(tray);
1267 } 1269 }
1268 1270
1269 } // namespace chromeos 1271 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/network_menu.cc ('k') | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698