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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 6901031: Profile shouldn't own Session/TabRestore services. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again and hope upload works this time Created 9 years, 8 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
« no previous file with comments | « chrome/browser/ui/gtk/global_history_menu.cc ('k') | chrome/browser/ui/webui/new_tab_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/frame/browser_view.h" 5 #include "chrome/browser/ui/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 13 matching lines...) Expand all
24 #include "chrome/browser/debugger/devtools_window.h" 24 #include "chrome/browser/debugger/devtools_window.h"
25 #include "chrome/browser/download/download_manager.h" 25 #include "chrome/browser/download/download_manager.h"
26 #include "chrome/browser/extensions/extension_tab_helper.h" 26 #include "chrome/browser/extensions/extension_tab_helper.h"
27 #include "chrome/browser/extensions/extension_tts_api.h" 27 #include "chrome/browser/extensions/extension_tts_api.h"
28 #include "chrome/browser/instant/instant_controller.h" 28 #include "chrome/browser/instant/instant_controller.h"
29 #include "chrome/browser/ntp_background_util.h" 29 #include "chrome/browser/ntp_background_util.h"
30 #include "chrome/browser/page_info_window.h" 30 #include "chrome/browser/page_info_window.h"
31 #include "chrome/browser/prefs/pref_service.h" 31 #include "chrome/browser/prefs/pref_service.h"
32 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
33 #include "chrome/browser/sessions/tab_restore_service.h" 33 #include "chrome/browser/sessions/tab_restore_service.h"
34 #include "chrome/browser/sessions/tab_restore_service_factory.h"
34 #include "chrome/browser/sidebar/sidebar_container.h" 35 #include "chrome/browser/sidebar/sidebar_container.h"
35 #include "chrome/browser/sidebar/sidebar_manager.h" 36 #include "chrome/browser/sidebar/sidebar_manager.h"
36 #include "chrome/browser/tabs/tab_strip_model.h" 37 #include "chrome/browser/tabs/tab_strip_model.h"
37 #include "chrome/browser/themes/theme_service.h" 38 #include "chrome/browser/themes/theme_service.h"
38 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" 39 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
39 #include "chrome/browser/ui/browser.h" 40 #include "chrome/browser/ui/browser.h"
40 #include "chrome/browser/ui/browser_dialogs.h" 41 #include "chrome/browser/ui/browser_dialogs.h"
41 #include "chrome/browser/ui/browser_list.h" 42 #include "chrome/browser/ui/browser_list.h"
42 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 43 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
43 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" 44 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 1362
1362 bool BrowserView::IsItemForCommandIdDynamic(int command_id) const { 1363 bool BrowserView::IsItemForCommandIdDynamic(int command_id) const {
1363 return command_id == IDC_RESTORE_TAB; 1364 return command_id == IDC_RESTORE_TAB;
1364 } 1365 }
1365 1366
1366 string16 BrowserView::GetLabelForCommandId(int command_id) const { 1367 string16 BrowserView::GetLabelForCommandId(int command_id) const {
1367 DCHECK(command_id == IDC_RESTORE_TAB); 1368 DCHECK(command_id == IDC_RESTORE_TAB);
1368 1369
1369 int string_id = IDS_RESTORE_TAB; 1370 int string_id = IDS_RESTORE_TAB;
1370 if (IsCommandIdEnabled(command_id)) { 1371 if (IsCommandIdEnabled(command_id)) {
1371 TabRestoreService* trs = browser_->profile()->GetTabRestoreService(); 1372 TabRestoreService* trs =
1373 TabRestoreServiceFactory::GetForProfile(browser_->profile());
1372 if (trs && trs->entries().front()->type == TabRestoreService::WINDOW) 1374 if (trs && trs->entries().front()->type == TabRestoreService::WINDOW)
1373 string_id = IDS_RESTORE_WINDOW; 1375 string_id = IDS_RESTORE_WINDOW;
1374 } 1376 }
1375 return l10n_util::GetStringUTF16(string_id); 1377 return l10n_util::GetStringUTF16(string_id);
1376 } 1378 }
1377 1379
1378 void BrowserView::ExecuteCommand(int command_id) { 1380 void BrowserView::ExecuteCommand(int command_id) {
1379 browser_->ExecuteCommandIfEnabled(command_id); 1381 browser_->ExecuteCommandIfEnabled(command_id);
1380 } 1382 }
1381 1383
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 2452 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
2451 2453
2452 return view; 2454 return view;
2453 } 2455 }
2454 #endif 2456 #endif
2455 2457
2456 // static 2458 // static
2457 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2459 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2458 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2460 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2459 } 2461 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/global_history_menu.cc ('k') | chrome/browser/ui/webui/new_tab_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698