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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 9295049: Allow focus to be sent between browser window and launcher/status window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 3ae89ba94378e08744c20600fae131a099bb738c..96da5c19fdbc51765376b4d54501661c78a2ff76 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -109,6 +109,7 @@
#include "ash/launcher/launcher.h"
#include "ash/launcher/launcher_model.h"
#include "ash/shell.h"
+#include "chrome/browser/chromeos/status/status_area_view.h"
#include "chrome/browser/ui/views/accelerator_table.h"
#include "chrome/browser/ui/views/aura/chrome_shell_delegate.h"
#include "chrome/browser/ui/views/aura/launcher_icon_updater.h"
@@ -964,9 +965,11 @@ void BrowserView::RotatePaneFocus(bool forwards) {
std::vector<views::View*> accessible_views(
accessible_panes.begin(), accessible_panes.end());
+
accessible_views.push_back(GetTabContentsContainerView());
if (devtools_container_->visible())
accessible_views.push_back(devtools_container_->GetFocusView());
+
int count = static_cast<int>(accessible_views.size());
// Figure out which view (if any) currently has the focus.
@@ -987,6 +990,21 @@ void BrowserView::RotatePaneFocus(bool forwards) {
if (focused_view && index >= pane_count)
GetFocusManager()->StoreFocusedView();
+ // Add the special panes to the rotation.
+ int normal_count = count;
+
+#if defined(OS_CHROMEOS) && defined(USE_AURA)
+ int status_area_index = count;
+ ++count;
+
+ int launcher_index = -1;
+ if (!ash::Shell::GetInstance()->IsWindowModeCompact()) {
+ // Add the launcher if not in compact mode.
+ launcher_index = count;
+ ++count;
+ }
+#endif
+
// Try to focus the next pane; if SetPaneFocusAndFocusDefault returns
// false it means the pane didn't have any focusable controls, so skip
// it and try the next one.
@@ -996,7 +1014,22 @@ void BrowserView::RotatePaneFocus(bool forwards) {
else
index = ((index - 1) + count) % count;
- if (index < pane_count) {
+ if (index >= normal_count) {
+#if defined(OS_CHROMEOS) && defined(USE_AURA)
+ if (index == status_area_index) {
+ StatusAreaView* status_area =
+ ChromeShellDelegate::instance()->GetStatusArea();
+ if (status_area->SetPaneFocusAndFocusDefault()) {
+ status_area->GetWidget()->Activate();
+ break;
+ }
+ } else if (index == launcher_index) {
+ if (ash::Shell::GetInstance()->launcher()->Activate()) {
+ break;
+ }
+ }
+#endif
+ } else if (index < pane_count) {
if (accessible_panes[index]->SetPaneFocusAndFocusDefault())
break;
} else {
« ash/launcher/launcher.cc ('K') | « chrome/browser/ui/views/aura/chrome_shell_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698