OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/views/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
6 | 6 |
7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 bool BrowserView::GetAcceleratorForCommandId(int command_id, | 1044 bool BrowserView::GetAcceleratorForCommandId(int command_id, |
1045 views::Accelerator* accelerator) { | 1045 views::Accelerator* accelerator) { |
1046 // Let's let the ToolbarView own the canonical implementation of this method. | 1046 // Let's let the ToolbarView own the canonical implementation of this method. |
1047 return toolbar_->GetAcceleratorForCommandId(command_id, accelerator); | 1047 return toolbar_->GetAcceleratorForCommandId(command_id, accelerator); |
1048 } | 1048 } |
1049 | 1049 |
1050 bool BrowserView::IsLabelForCommandIdDynamic(int command_id) const { | 1050 bool BrowserView::IsLabelForCommandIdDynamic(int command_id) const { |
1051 return command_id == IDC_RESTORE_TAB; | 1051 return command_id == IDC_RESTORE_TAB; |
1052 } | 1052 } |
1053 | 1053 |
1054 std::wstring BrowserView::GetLabelForCommandId(int command_id) const { | 1054 string16 BrowserView::GetLabelForCommandId(int command_id) const { |
1055 DCHECK(command_id == IDC_RESTORE_TAB); | 1055 DCHECK(command_id == IDC_RESTORE_TAB); |
1056 | 1056 |
1057 int string_id = IDS_RESTORE_TAB; | 1057 int string_id = IDS_RESTORE_TAB; |
1058 if (IsCommandIdEnabled(command_id)) { | 1058 if (IsCommandIdEnabled(command_id)) { |
1059 TabRestoreService* trs = browser_->profile()->GetTabRestoreService(); | 1059 TabRestoreService* trs = browser_->profile()->GetTabRestoreService(); |
1060 if (trs && trs->entries().front()->type == TabRestoreService::WINDOW) | 1060 if (trs && trs->entries().front()->type == TabRestoreService::WINDOW) |
1061 string_id = IDS_RESTORE_WINDOW; | 1061 string_id = IDS_RESTORE_WINDOW; |
1062 } | 1062 } |
1063 return l10n_util::GetString(string_id); | 1063 return l10n_util::GetStringUTF16(string_id); |
1064 } | 1064 } |
1065 | 1065 |
1066 void BrowserView::ExecuteCommand(int command_id) { | 1066 void BrowserView::ExecuteCommand(int command_id) { |
1067 browser_->ExecuteCommand(command_id); | 1067 browser_->ExecuteCommand(command_id); |
1068 } | 1068 } |
1069 | 1069 |
1070 /////////////////////////////////////////////////////////////////////////////// | 1070 /////////////////////////////////////////////////////////////////////////////// |
1071 // BrowserView, views::WindowDelegate implementation: | 1071 // BrowserView, views::WindowDelegate implementation: |
1072 | 1072 |
1073 bool BrowserView::CanResize() const { | 1073 bool BrowserView::CanResize() const { |
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1812 | 1812 |
1813 // static | 1813 // static |
1814 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1814 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
1815 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 1815 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
1816 } | 1816 } |
1817 | 1817 |
1818 // static | 1818 // static |
1819 void BrowserList::AllBrowsersClosed() { | 1819 void BrowserList::AllBrowsersClosed() { |
1820 views::Window::CloseAllSecondaryWindows(); | 1820 views::Window::CloseAllSecondaryWindows(); |
1821 } | 1821 } |
OLD | NEW |