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

Unified Diff: chrome/browser/ui/views/ash/chrome_shell_delegate.cc

Issue 9719037: Aura: Add non-browser windows into the list of "Alt + Tab" cycle list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_util.cc ('k') | ui/aura/client/activation_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/views/ash/chrome_shell_delegate.cc b/chrome/browser/ui/views/ash/chrome_shell_delegate.cc
index 9755c2ce7b02f688b16c849400330d12de6e6f98..1f12d70994148961fbc55f7a2546bef6a8165e8d 100644
--- a/chrome/browser/ui/views/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/views/ash/chrome_shell_delegate.cc
@@ -4,7 +4,10 @@
#include "chrome/browser/ui/views/ash/chrome_shell_delegate.h"
+#include <algorithm>
+
#include "ash/launcher/launcher_types.h"
+#include "ash/shell_window_ids.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/wm/partial_screenshot_view.h"
#include "ash/wm/window_util.h"
@@ -31,22 +34,6 @@
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/system/ash_system_tray_delegate.h"
#endif
-namespace {
-
-// Returns a list of Aura windows from a BrowserList, using either a
-// const_iterator or const_reverse_iterator.
-template<typename IT>
-std::vector<aura::Window*> GetBrowserWindows(IT begin, IT end) {
- std::vector<aura::Window*> windows;
- for (IT it = begin; it != end; ++it) {
- Browser* browser = *it;
- if (browser && browser->window()->GetNativeHandle())
- windows.push_back(browser->window()->GetNativeHandle());
- }
- return windows;
-}
-
-} // namespace
// static
ChromeShellDelegate* ChromeShellDelegate::instance_ = NULL;
@@ -133,9 +120,19 @@ ChromeShellDelegate::CreateAppListViewDelegate() {
std::vector<aura::Window*> ChromeShellDelegate::GetCycleWindowList(
CycleSource source) const {
- // BrowserList maintains a list of browsers sorted by activity.
- return GetBrowserWindows(BrowserList::begin_last_active(),
- BrowserList::end_last_active());
+ aura::Window* default_container = ash::Shell::GetInstance()->GetContainer(
+ ash::internal::kShellWindowId_DefaultContainer);
+ std::vector<aura::Window*> windows = default_container->children();
+ // Removes unforcusable windows.
+ std::vector<aura::Window*>::iterator last =
+ std::remove_if(
+ windows.begin(),
+ windows.end(),
+ std::not1(std::ptr_fun(ash::wm::CanActivateWindow)));
+ windows.erase(last, windows.end());
+ // Window cycling expects the topmost window at the front of the list.
+ std::reverse(windows.begin(), windows.end());
+ return windows;
}
void ChromeShellDelegate::StartPartialScreenshot(
« no previous file with comments | « ash/wm/window_util.cc ('k') | ui/aura/client/activation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698