Chromium Code Reviews| 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/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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 312 | 312 |
| 313 TabContents* tab_contents = browser->GetSelectedTabContents(); | 313 TabContents* tab_contents = browser->GetSelectedTabContents(); |
| 314 tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 314 tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 315 tab_contents->render_view_host()->SyncRendererPrefs(); | 315 tab_contents->render_view_host()->SyncRendererPrefs(); |
| 316 browser->window()->Show(); | 316 browser->window()->Show(); |
| 317 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial | 317 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial |
| 318 // focus explicitly. | 318 // focus explicitly. |
| 319 tab_contents->view()->SetInitialFocus(); | 319 tab_contents->view()->SetInitialFocus(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 #if defined(OS_MACOSX) | |
| 323 // static | |
| 324 void Browser::OpenHelpWindow(Profile* profile) { | |
|
pink (ping after 24hrs)
2009/10/22 18:22:56
we don't follow this pattern for anything else (th
| |
| 325 Browser* browser = Browser::Create(profile); | |
| 326 browser->OpenHelpTab(); | |
| 327 browser->window()->Show(); | |
| 328 } | |
| 329 #endif | |
| 330 | |
| 322 /////////////////////////////////////////////////////////////////////////////// | 331 /////////////////////////////////////////////////////////////////////////////// |
| 323 // Browser, State Storage and Retrieval for UI: | 332 // Browser, State Storage and Retrieval for UI: |
| 324 | 333 |
| 325 std::wstring Browser::GetWindowPlacementKey() const { | 334 std::wstring Browser::GetWindowPlacementKey() const { |
| 326 std::wstring name(prefs::kBrowserWindowPlacement); | 335 std::wstring name(prefs::kBrowserWindowPlacement); |
| 327 if (!app_name_.empty()) { | 336 if (!app_name_.empty()) { |
| 328 name.append(L"_"); | 337 name.append(L"_"); |
| 329 name.append(app_name_); | 338 name.append(app_name_); |
| 330 } | 339 } |
| 331 return name; | 340 return name; |
| (...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2919 /////////////////////////////////////////////////////////////////////////////// | 2928 /////////////////////////////////////////////////////////////////////////////// |
| 2920 // BrowserToolbarModel (private): | 2929 // BrowserToolbarModel (private): |
| 2921 | 2930 |
| 2922 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2931 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2923 // This |current_tab| can be NULL during the initialization of the | 2932 // This |current_tab| can be NULL during the initialization of the |
| 2924 // toolbar during window creation (i.e. before any tabs have been added | 2933 // toolbar during window creation (i.e. before any tabs have been added |
| 2925 // to the window). | 2934 // to the window). |
| 2926 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2935 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2927 return current_tab ? ¤t_tab->controller() : NULL; | 2936 return current_tab ? ¤t_tab->controller() : NULL; |
| 2928 } | 2937 } |
| OLD | NEW |