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

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

Issue 183853037: aura: Remove client::UserActionClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unrevert Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/frame/desktop_user_action_handler_aura.h"
6
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/tabs/tab_strip_model.h"
9 #include "content/public/browser/web_contents.h"
10
11 DesktopUserActionHandlerAura::DesktopUserActionHandlerAura(Browser* browser)
12 : browser_(browser) {
13 }
14
15 DesktopUserActionHandlerAura::~DesktopUserActionHandlerAura() {}
16
17 bool DesktopUserActionHandlerAura::OnUserAction(
18 aura::client::UserActionClient::Command command) {
19 switch (command) {
20 case aura::client::UserActionClient::BACK: {
21 content::WebContents* contents = GetActiveWebContents();
22 if (contents && contents->GetController().CanGoBack()) {
23 contents->GetController().GoBack();
24 return true;
25 }
26 break;
27 }
28 case aura::client::UserActionClient::FORWARD: {
29 content::WebContents* contents = GetActiveWebContents();
30 if (contents && contents->GetController().CanGoForward()) {
31 contents->GetController().GoForward();
32 return true;
33 }
34 break;
35 }
36 default:
37 break;
38 }
39 return false;
40 }
41
42 content::WebContents*
43 DesktopUserActionHandlerAura::GetActiveWebContents() const {
44 return browser_->tab_strip_model()->GetActiveWebContents();
45 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/desktop_user_action_handler_aura.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698