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

Side by Side Diff: chrome/browser/ui/panels/old_panel.cc

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (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/panels/old_panel.h" 5 #include "chrome/browser/ui/panels/old_panel.h"
6 6
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_command_controller.h"
8 #include "chrome/browser/ui/panels/panel_browser_window.h" 9 #include "chrome/browser/ui/panels/panel_browser_window.h"
9 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
10 11
11 OldPanel::OldPanel(Browser* browser, 12 OldPanel::OldPanel(Browser* browser,
12 const gfx::Size& min_size, const gfx::Size& max_size) 13 const gfx::Size& min_size, const gfx::Size& max_size)
13 : Panel(browser->app_name(), min_size, max_size), 14 : Panel(browser->app_name(), min_size, max_size),
14 browser_(browser) { 15 browser_(browser) {
15 } 16 }
16 17
17 OldPanel::~OldPanel() {} 18 OldPanel::~OldPanel() {}
18 19
19 Browser* OldPanel::browser() const { 20 Browser* OldPanel::browser() const {
20 return browser_; 21 return browser_;
21 } 22 }
22 23
23 BrowserWindow* OldPanel::browser_window() const { 24 BrowserWindow* OldPanel::browser_window() const {
24 return panel_browser_window_.get(); 25 return panel_browser_window_.get();
25 } 26 }
26 27
27 CommandUpdater* OldPanel::command_updater() { 28 CommandUpdater* OldPanel::command_updater() {
28 return browser_->command_updater(); 29 return browser_->command_controller()->command_updater();
29 } 30 }
30 31
31 Profile* OldPanel::profile() const { 32 Profile* OldPanel::profile() const {
32 return browser_->profile(); 33 return browser_->profile();
33 } 34 }
34 35
35 void OldPanel::Initialize(const gfx::Rect& bounds, Browser* browser) { 36 void OldPanel::Initialize(const gfx::Rect& bounds, Browser* browser) {
36 Panel::Initialize(bounds, browser); 37 Panel::Initialize(bounds, browser);
37 panel_browser_window_.reset( 38 panel_browser_window_.reset(
38 new PanelBrowserWindow(browser, this, native_panel())); 39 new PanelBrowserWindow(browser, this, native_panel()));
39 } 40 }
40 41
41 content::WebContents* OldPanel::WebContents() const { 42 content::WebContents* OldPanel::WebContents() const {
42 return browser_->GetActiveWebContents(); 43 return browser_->GetActiveWebContents();
43 } 44 }
44 45
45 bool OldPanel::ShouldCloseWindow() { 46 bool OldPanel::ShouldCloseWindow() {
46 return browser_->ShouldCloseWindow(); 47 return browser_->ShouldCloseWindow();
47 } 48 }
48 49
49 void OldPanel::OnWindowClosing() { 50 void OldPanel::OnWindowClosing() {
50 browser_->OnWindowClosing(); 51 browser_->OnWindowClosing();
51 } 52 }
52 53
53 void OldPanel::ExecuteCommandWithDisposition( 54 void OldPanel::ExecuteCommandWithDisposition(
54 int id, WindowOpenDisposition disposition) { 55 int id, WindowOpenDisposition disposition) {
55 browser_->ExecuteCommandWithDisposition(id, disposition); 56 chrome::ExecuteCommandWithDisposition(browser_, id, disposition);
56 } 57 }
57 58
58 SkBitmap OldPanel::GetCurrentPageIcon() const { 59 SkBitmap OldPanel::GetCurrentPageIcon() const {
59 return browser_->GetCurrentPageIcon(); 60 return browser_->GetCurrentPageIcon();
60 } 61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698