| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "chrome/browser/ui/view_ids.h" | 6 #include "chrome/browser/ui/view_ids.h" |
| 7 #include "chrome/browser/ui/views/frame/browser_view.h" | 7 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 9 #include "chrome/browser/ui/views/accessible_pane_view.h" | 9 #include "chrome/browser/ui/views/accessible_pane_view.h" |
| 10 #include "views/controls/button/menu_button.h" | 10 #include "views/controls/button/menu_button.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 void AccessiblePaneView::LocationBarSelectAll() { | 101 void AccessiblePaneView::LocationBarSelectAll() { |
| 102 views::View* focused_view = GetFocusManager()->GetFocusedView(); | 102 views::View* focused_view = GetFocusManager()->GetFocusedView(); |
| 103 if (focused_view && | 103 if (focused_view && |
| 104 focused_view->GetClassName() == LocationBarView::kViewClassName) { | 104 focused_view->GetClassName() == LocationBarView::kViewClassName) { |
| 105 static_cast<LocationBarView*>(focused_view)->SelectAll(); | 105 static_cast<LocationBarView*>(focused_view)->SelectAll(); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void AccessiblePaneView::RestoreLastFocusedView() { | 109 void AccessiblePaneView::RestoreLastFocusedView() { |
| 110 views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); | 110 views::ViewStorage* view_storage = views::ViewStorage::GetInstance(); |
| 111 views::View* last_focused_view = | 111 views::View* last_focused_view = |
| 112 view_storage->RetrieveView(last_focused_view_storage_id_); | 112 view_storage->RetrieveView(last_focused_view_storage_id_); |
| 113 if (last_focused_view) { | 113 if (last_focused_view) { |
| 114 focus_manager_->SetFocusedViewWithReason( | 114 focus_manager_->SetFocusedViewWithReason( |
| 115 last_focused_view, views::FocusManager::kReasonFocusRestore); | 115 last_focused_view, views::FocusManager::kReasonFocusRestore); |
| 116 } else { | 116 } else { |
| 117 // Focus the location bar | 117 // Focus the location bar |
| 118 views::View* view = GetAncestorWithClassName(BrowserView::kViewClassName); | 118 views::View* view = GetAncestorWithClassName(BrowserView::kViewClassName); |
| 119 if (view) { | 119 if (view) { |
| 120 BrowserView* browser_view = static_cast<BrowserView*>(view); | 120 BrowserView* browser_view = static_cast<BrowserView*>(view); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 242 |
| 243 views::FocusTraversable* AccessiblePaneView::GetFocusTraversableParent() { | 243 views::FocusTraversable* AccessiblePaneView::GetFocusTraversableParent() { |
| 244 DCHECK(pane_has_focus_); | 244 DCHECK(pane_has_focus_); |
| 245 return NULL; | 245 return NULL; |
| 246 } | 246 } |
| 247 | 247 |
| 248 views::View* AccessiblePaneView::GetFocusTraversableParentView() { | 248 views::View* AccessiblePaneView::GetFocusTraversableParentView() { |
| 249 DCHECK(pane_has_focus_); | 249 DCHECK(pane_has_focus_); |
| 250 return NULL; | 250 return NULL; |
| 251 } | 251 } |
| OLD | NEW |