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

Side by Side Diff: chrome/browser/ui/views/ash/user_action_handler.cc

Issue 10540100: TabContentsWrapper -> TabContents, part 48. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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) 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/ash/user_action_handler.h" 5 #include "chrome/browser/ui/views/ash/user_action_handler.h"
6 6
7 #include "ash/wm/window_util.h" 7 #include "ash/wm/window_util.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_list.h" 9 #include "chrome/browser/ui/browser_list.h"
10 #include "chrome/browser/ui/browser_window.h" 10 #include "chrome/browser/ui/browser_window.h"
11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 11 #include "chrome/browser/ui/tab_contents/tab_contents.h"
12 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
13 13
14 // Returns the currently-active WebContents belonging to the active browser, or 14 // Returns the currently-active WebContents belonging to the active browser, or
15 // NULL if there's no currently-active browser. 15 // NULL if there's no currently-active browser.
16 content::WebContents* GetActiveWebContents() { 16 content::WebContents* GetActiveWebContents() {
17 Browser* browser = BrowserList::GetLastActive(); 17 Browser* browser = BrowserList::GetLastActive();
18 if (!browser) 18 if (!browser)
19 return NULL; 19 return NULL;
20 if (!ash::wm::IsActiveWindow(browser->window()->GetNativeWindow())) 20 if (!ash::wm::IsActiveWindow(browser->window()->GetNativeWindow()))
21 return NULL; 21 return NULL;
22 22
23 TabContentsWrapper* wrapper = browser->GetSelectedTabContentsWrapper(); 23 return browser->GetActiveWebContents();
24 if (!wrapper)
25 return NULL;
26 return wrapper->web_contents();
27 } 24 }
28 25
29 UserActionHandler::UserActionHandler() {} 26 UserActionHandler::UserActionHandler() {}
30 27
31 UserActionHandler::~UserActionHandler() {} 28 UserActionHandler::~UserActionHandler() {}
32 29
33 bool UserActionHandler::OnUserAction( 30 bool UserActionHandler::OnUserAction(
34 aura::client::UserActionClient::Command command) { 31 aura::client::UserActionClient::Command command) {
35 switch (command) { 32 switch (command) {
36 case aura::client::UserActionClient::BACK: { 33 case aura::client::UserActionClient::BACK: {
(...skipping 10 matching lines...) Expand all
47 contents->GetController().GoForward(); 44 contents->GetController().GoForward();
48 return true; 45 return true;
49 } 46 }
50 break; 47 break;
51 } 48 }
52 default: 49 default:
53 break; 50 break;
54 } 51 }
55 return false; 52 return false;
56 } 53 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/panel_view_aura.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698