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

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

Issue 2108933003: Reorder browser list on workspace switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Desktop class and remove global OnWorkspaceChanged Created 4 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_frame.h" 5 #include "chrome/browser/ui/views/frame/browser_frame.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/leak_annotations.h" 10 #include "base/debug/leak_annotations.h"
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // remote desktop will be activated. However, NativeWidget::Activate() will 213 // remote desktop will be activated. However, NativeWidget::Activate() will
214 // still bring this browser window to the foreground. We explicitly set 214 // still bring this browser window to the foreground. We explicitly set
215 // ourselves as the last active browser window to ensure that we get treated 215 // ourselves as the last active browser window to ensure that we get treated
216 // as such by the rest of Chrome. 216 // as such by the rest of Chrome.
217 BrowserList::SetLastActive(browser_view_->browser()); 217 BrowserList::SetLastActive(browser_view_->browser());
218 } 218 }
219 Widget::OnNativeWidgetActivationChanged(active); 219 Widget::OnNativeWidgetActivationChanged(active);
220 } 220 }
221 221
222 void BrowserFrame::OnNativeWidgetWorkspaceChanged() { 222 void BrowserFrame::OnNativeWidgetWorkspaceChanged() {
223 chrome::SaveWindowWorkspace(browser_view_->browser(), GetWorkspace()); 223 Browser* browser = browser_view_->browser();
224 chrome::SaveWindowWorkspace(browser, GetWorkspace());
225 BrowserList::SetLastActive(browser);
224 Widget::OnNativeWidgetWorkspaceChanged(); 226 Widget::OnNativeWidgetWorkspaceChanged();
225 } 227 }
226 228
227 void BrowserFrame::ShowContextMenuForView(views::View* source, 229 void BrowserFrame::ShowContextMenuForView(views::View* source,
228 const gfx::Point& p, 230 const gfx::Point& p,
229 ui::MenuSourceType source_type) { 231 ui::MenuSourceType source_type) {
230 if (chrome::IsRunningInForcedAppMode()) 232 if (chrome::IsRunningInForcedAppMode())
231 return; 233 return;
232 234
233 // Only show context menu if point is in unobscured parts of browser, i.e. 235 // Only show context menu if point is in unobscured parts of browser, i.e.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 menu_model_builder_.reset( 270 menu_model_builder_.reset(
269 new SystemMenuModelBuilder(browser_view_, browser_view_->browser())); 271 new SystemMenuModelBuilder(browser_view_, browser_view_->browser()));
270 menu_model_builder_->Init(); 272 menu_model_builder_->Init();
271 } 273 }
272 return menu_model_builder_->menu_model(); 274 return menu_model_builder_->menu_model();
273 } 275 }
274 276
275 views::View* BrowserFrame::GetNewAvatarMenuButton() { 277 views::View* BrowserFrame::GetNewAvatarMenuButton() {
276 return browser_frame_view_->GetProfileSwitcherView(); 278 return browser_frame_view_->GetProfileSwitcherView();
277 } 279 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_list.cc ('k') | ui/display/BUILD.gn » ('j') | ui/display/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698