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" | 8 #include "chrome/browser/ui/browser_command_controller.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/browser_tabstrip.h" |
10 #include "chrome/browser/ui/panels/panel_browser_window.h" | 11 #include "chrome/browser/ui/panels/panel_browser_window.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
12 | 13 |
13 OldPanel::OldPanel(Browser* browser, | 14 OldPanel::OldPanel(Browser* browser, |
14 const gfx::Size& min_size, const gfx::Size& max_size) | 15 const gfx::Size& min_size, const gfx::Size& max_size) |
15 : Panel(browser->app_name(), min_size, max_size), | 16 : Panel(browser->app_name(), min_size, max_size), |
16 browser_(browser) { | 17 browser_(browser) { |
17 } | 18 } |
18 | 19 |
19 OldPanel::~OldPanel() {} | 20 OldPanel::~OldPanel() {} |
(...skipping 14 matching lines...) Expand all Loading... |
34 return browser_->profile(); | 35 return browser_->profile(); |
35 } | 36 } |
36 | 37 |
37 void OldPanel::Initialize(const gfx::Rect& bounds, Browser* browser) { | 38 void OldPanel::Initialize(const gfx::Rect& bounds, Browser* browser) { |
38 Panel::Initialize(bounds, browser); | 39 Panel::Initialize(bounds, browser); |
39 panel_browser_window_.reset( | 40 panel_browser_window_.reset( |
40 new PanelBrowserWindow(browser, this, native_panel())); | 41 new PanelBrowserWindow(browser, this, native_panel())); |
41 } | 42 } |
42 | 43 |
43 content::WebContents* OldPanel::WebContents() const { | 44 content::WebContents* OldPanel::WebContents() const { |
44 return browser_->GetActiveWebContents(); | 45 return chrome::GetActiveWebContents(browser_); |
45 } | 46 } |
46 | 47 |
47 bool OldPanel::ShouldCloseWindow() { | 48 bool OldPanel::ShouldCloseWindow() { |
48 return browser_->ShouldCloseWindow(); | 49 return browser_->ShouldCloseWindow(); |
49 } | 50 } |
50 | 51 |
51 void OldPanel::OnWindowClosing() { | 52 void OldPanel::OnWindowClosing() { |
52 browser_->OnWindowClosing(); | 53 browser_->OnWindowClosing(); |
53 } | 54 } |
54 | 55 |
55 void OldPanel::ExecuteCommandWithDisposition( | 56 void OldPanel::ExecuteCommandWithDisposition( |
56 int id, WindowOpenDisposition disposition) { | 57 int id, WindowOpenDisposition disposition) { |
57 chrome::ExecuteCommandWithDisposition(browser_, id, disposition); | 58 chrome::ExecuteCommandWithDisposition(browser_, id, disposition); |
58 } | 59 } |
59 | 60 |
60 SkBitmap OldPanel::GetCurrentPageIcon() const { | 61 SkBitmap OldPanel::GetCurrentPageIcon() const { |
61 return browser_->GetCurrentPageIcon(); | 62 return browser_->GetCurrentPageIcon(); |
62 } | 63 } |
OLD | NEW |