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/favicon/favicon_tab_helper.h" |
7 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_command_controller.h" | 9 #include "chrome/browser/ui/browser_command_controller.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
10 #include "chrome/browser/ui/browser_tabstrip.h" | 11 #include "chrome/browser/ui/browser_tabstrip.h" |
11 #include "chrome/browser/ui/panels/panel_browser_window.h" | 12 #include "chrome/browser/ui/panels/panel_browser_window.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "chrome/browser/ui/browser_tabstrip.h" |
| 14 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 15 #include "ui/gfx/image/image.h" |
13 | 16 |
14 OldPanel::OldPanel(Browser* browser, | 17 OldPanel::OldPanel(Browser* browser, |
15 const gfx::Size& min_size, const gfx::Size& max_size) | 18 const gfx::Size& min_size, const gfx::Size& max_size) |
16 : Panel(browser->app_name(), min_size, max_size), | 19 : Panel(browser->app_name(), min_size, max_size), |
17 browser_(browser) { | 20 browser_(browser) { |
18 } | 21 } |
19 | 22 |
20 OldPanel::~OldPanel() {} | 23 OldPanel::~OldPanel() {} |
21 | 24 |
22 Browser* OldPanel::browser() const { | 25 Browser* OldPanel::browser() const { |
(...skipping 28 matching lines...) Expand all Loading... |
51 | 54 |
52 void OldPanel::OnWindowClosing() { | 55 void OldPanel::OnWindowClosing() { |
53 browser_->OnWindowClosing(); | 56 browser_->OnWindowClosing(); |
54 } | 57 } |
55 | 58 |
56 void OldPanel::ExecuteCommandWithDisposition( | 59 void OldPanel::ExecuteCommandWithDisposition( |
57 int id, WindowOpenDisposition disposition) { | 60 int id, WindowOpenDisposition disposition) { |
58 chrome::ExecuteCommandWithDisposition(browser_, id, disposition); | 61 chrome::ExecuteCommandWithDisposition(browser_, id, disposition); |
59 } | 62 } |
60 | 63 |
61 SkBitmap OldPanel::GetCurrentPageIcon() const { | 64 gfx::Image OldPanel::GetCurrentPageIcon() const { |
62 return browser_->GetCurrentPageIcon(); | 65 // Browser has not been changed to return SkBitmap yet so we get the favicon |
| 66 // directly rather than use browser_->GetCurrentPageIcon(). |
| 67 TabContents* contents = chrome::GetActiveTabContents(browser_); |
| 68 return contents ? contents->favicon_tab_helper()->GetFavicon() : gfx::Image(); |
63 } | 69 } |
OLD | NEW |