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