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/ash/system_tray_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 void SystemTrayDelegateChromeOS::ShowChromeSlow() { | 486 void SystemTrayDelegateChromeOS::ShowChromeSlow() { |
487 chrome::ScopedTabbedBrowserDisplayer displayer( | 487 chrome::ScopedTabbedBrowserDisplayer displayer( |
488 ProfileManager::GetPrimaryUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); | 488 ProfileManager::GetPrimaryUserProfile(), chrome::HOST_DESKTOP_TYPE_ASH); |
489 chrome::ShowSlow(displayer.browser()); | 489 chrome::ShowSlow(displayer.browser()); |
490 } | 490 } |
491 | 491 |
492 bool SystemTrayDelegateChromeOS::ShouldShowDisplayNotification() { | 492 bool SystemTrayDelegateChromeOS::ShouldShowDisplayNotification() { |
493 // Packaged app is not counted as 'last active', so if a browser opening the | 493 // Packaged app is not counted as 'last active', so if a browser opening the |
494 // display settings is in background of a packaged app, it will return true. | 494 // display settings is in background of a packaged app, it will return true. |
495 // TODO(mukai): fix this. | 495 // TODO(mukai): fix this. |
496 Browser* active_browser = | 496 Browser* active_browser = chrome::FindLastActive(); |
497 chrome::FindLastActiveWithHostDesktopType(chrome::HOST_DESKTOP_TYPE_ASH); | |
498 if (!active_browser) | 497 if (!active_browser) |
499 return true; | 498 return true; |
500 | 499 |
501 content::WebContents* active_contents = | 500 content::WebContents* active_contents = |
502 active_browser->tab_strip_model()->GetActiveWebContents(); | 501 active_browser->tab_strip_model()->GetActiveWebContents(); |
503 if (!active_contents) | 502 if (!active_contents) |
504 return true; | 503 return true; |
505 | 504 |
506 GURL visible_url = active_contents->GetLastCommittedURL(); | 505 GURL visible_url = active_contents->GetLastCommittedURL(); |
507 return !(chrome::IsSettingsSubPage(visible_url, | 506 return !(chrome::IsSettingsSubPage(visible_url, |
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1328 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " | 1327 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " |
1329 << "ENABLE_SUPERVISED_USERS undefined."; | 1328 << "ENABLE_SUPERVISED_USERS undefined."; |
1330 return base::string16(); | 1329 return base::string16(); |
1331 } | 1330 } |
1332 | 1331 |
1333 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1332 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1334 return new SystemTrayDelegateChromeOS(); | 1333 return new SystemTrayDelegateChromeOS(); |
1335 } | 1334 } |
1336 | 1335 |
1337 } // namespace chromeos | 1336 } // namespace chromeos |
OLD | NEW |