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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 6507028: Remove usages of RootView from View by moving relevant RootView API methods t... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 std::vector<views::View*> accessible_views( 958 std::vector<views::View*> accessible_views(
959 accessible_panes.begin(), accessible_panes.end()); 959 accessible_panes.begin(), accessible_panes.end());
960 accessible_views.push_back(GetTabContentsContainerView()); 960 accessible_views.push_back(GetTabContentsContainerView());
961 if (sidebar_container_ && sidebar_container_->IsVisible()) 961 if (sidebar_container_ && sidebar_container_->IsVisible())
962 accessible_views.push_back(GetSidebarContainerView()); 962 accessible_views.push_back(GetSidebarContainerView());
963 if (devtools_container_->IsVisible()) 963 if (devtools_container_->IsVisible())
964 accessible_views.push_back(devtools_container_->GetFocusView()); 964 accessible_views.push_back(devtools_container_->GetFocusView());
965 int count = static_cast<int>(accessible_views.size()); 965 int count = static_cast<int>(accessible_views.size());
966 966
967 // Figure out which view (if any) currently has the focus. 967 // Figure out which view (if any) currently has the focus.
968 views::View* focused_view = GetRootView()->GetFocusedView(); 968 views::View* focused_view = GetFocusManager()->GetFocusedView();
969 int index = -1; 969 int index = -1;
970 if (focused_view) { 970 if (focused_view) {
971 for (int i = 0; i < count; ++i) { 971 for (int i = 0; i < count; ++i) {
972 if (accessible_views[i] == focused_view || 972 if (accessible_views[i] == focused_view ||
973 accessible_views[i]->Contains(focused_view)) { 973 accessible_views[i]->Contains(focused_view)) {
974 index = i; 974 index = i;
975 break; 975 break;
976 } 976 }
977 } 977 }
978 } 978 }
(...skipping 21 matching lines...) Expand all
1000 accessible_views[index]->RequestFocus(); 1000 accessible_views[index]->RequestFocus();
1001 break; 1001 break;
1002 } 1002 }
1003 } 1003 }
1004 } 1004 }
1005 1005
1006 void BrowserView::SaveFocusedView() { 1006 void BrowserView::SaveFocusedView() {
1007 views::ViewStorage* view_storage = views::ViewStorage::GetInstance(); 1007 views::ViewStorage* view_storage = views::ViewStorage::GetInstance();
1008 if (view_storage->RetrieveView(last_focused_view_storage_id_)) 1008 if (view_storage->RetrieveView(last_focused_view_storage_id_))
1009 view_storage->RemoveView(last_focused_view_storage_id_); 1009 view_storage->RemoveView(last_focused_view_storage_id_);
1010 views::View* focused_view = GetRootView()->GetFocusedView(); 1010 views::View* focused_view = GetFocusManager()->GetFocusedView();
1011 if (focused_view) 1011 if (focused_view)
1012 view_storage->StoreView(last_focused_view_storage_id_, focused_view); 1012 view_storage->StoreView(last_focused_view_storage_id_, focused_view);
1013 } 1013 }
1014 1014
1015 void BrowserView::DestroyBrowser() { 1015 void BrowserView::DestroyBrowser() {
1016 // Explicitly delete the BookmarkBarView now. That way we don't have to 1016 // Explicitly delete the BookmarkBarView now. That way we don't have to
1017 // worry about the BookmarkBarView potentially outliving the Browser & 1017 // worry about the BookmarkBarView potentially outliving the Browser &
1018 // Profile. 1018 // Profile.
1019 bookmark_bar_view_.reset(); 1019 bookmark_bar_view_.reset();
1020 browser_.reset(); 1020 browser_.reset();
(...skipping 1550 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2571 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2572 2572
2573 return view; 2573 return view;
2574 } 2574 }
2575 #endif 2575 #endif
2576 2576
2577 // static 2577 // static
2578 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2578 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2579 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2579 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2580 } 2580 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_utils.cc ('k') | chrome/browser/ui/views/tab_contents/native_tab_contents_container_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698