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

Side by Side Diff: chrome/browser/browser.cc

Issue 329004: Mac: enable History, Downloads, and Open Location... with no windows open. (Closed)
Patch Set: Merged ToT. Created 11 years, 1 month 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
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | 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) 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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "app/animation.h" 7 #include "app/animation.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/keyboard_codes.h" 10 #include "base/keyboard_codes.h"
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 325 tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
326 tab_contents->render_view_host()->SyncRendererPrefs(); 326 tab_contents->render_view_host()->SyncRendererPrefs();
327 browser->window()->Show(); 327 browser->window()->Show();
328 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial 328 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial
329 // focus explicitly. 329 // focus explicitly.
330 tab_contents->view()->SetInitialFocus(); 330 tab_contents->view()->SetInitialFocus();
331 } 331 }
332 332
333 #if defined(OS_MACOSX) 333 #if defined(OS_MACOSX)
334 // static 334 // static
335 void Browser::OpenHistoryWindow(Profile* profile) {
336 Browser* browser = Browser::Create(profile);
337 browser->ShowHistoryTab();
338 browser->window()->Show();
339 }
340
341 // static
342 void Browser::OpenDownloadsWindow(Profile* profile) {
343 Browser* browser = Browser::Create(profile);
344 browser->ShowDownloadsTab();
345 browser->window()->Show();
346 }
347
348 // static
335 void Browser::OpenHelpWindow(Profile* profile) { 349 void Browser::OpenHelpWindow(Profile* profile) {
336 Browser* browser = Browser::Create(profile); 350 Browser* browser = Browser::Create(profile);
337 browser->OpenHelpTab(); 351 browser->OpenHelpTab();
338 browser->window()->Show(); 352 browser->window()->Show();
339 } 353 }
340 #endif 354 #endif
341 355
342 /////////////////////////////////////////////////////////////////////////////// 356 ///////////////////////////////////////////////////////////////////////////////
343 // Browser, State Storage and Retrieval for UI: 357 // Browser, State Storage and Retrieval for UI:
344 358
(...skipping 2634 matching lines...) Expand 10 before | Expand all | Expand 10 after
2979 /////////////////////////////////////////////////////////////////////////////// 2993 ///////////////////////////////////////////////////////////////////////////////
2980 // BrowserToolbarModel (private): 2994 // BrowserToolbarModel (private):
2981 2995
2982 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2996 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2983 // This |current_tab| can be NULL during the initialization of the 2997 // This |current_tab| can be NULL during the initialization of the
2984 // toolbar during window creation (i.e. before any tabs have been added 2998 // toolbar during window creation (i.e. before any tabs have been added
2985 // to the window). 2999 // to the window).
2986 TabContents* current_tab = browser_->GetSelectedTabContents(); 3000 TabContents* current_tab = browser_->GetSelectedTabContents();
2987 return current_tab ? &current_tab->controller() : NULL; 3001 return current_tab ? &current_tab->controller() : NULL;
2988 } 3002 }
OLDNEW
« no previous file with comments | « chrome/browser/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698