| 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/idle_timer.h" | 10 #include "base/idle_timer.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 } | 341 } |
| 342 | 342 |
| 343 // static | 343 // static |
| 344 void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { | 344 void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { |
| 345 std::wstring app_name = ComputeApplicationNameFromURL(url); | 345 std::wstring app_name = ComputeApplicationNameFromURL(url); |
| 346 RegisterAppPrefs(app_name); | 346 RegisterAppPrefs(app_name); |
| 347 | 347 |
| 348 Browser* browser = Browser::CreateForApp(app_name, profile, false); | 348 Browser* browser = Browser::CreateForApp(app_name, profile, false); |
| 349 browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, -1, | 349 browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, -1, |
| 350 false, NULL); | 350 false, NULL); |
| 351 #if defined(OS_WIN) |
| 352 // Set the app user model id for this application to that of the application |
| 353 // name. See http://crbug.com/7028. |
| 354 win_util::SetAppIdForWindow(app_name, browser->window()->GetNativeHandle()); |
| 355 #endif |
| 356 |
| 351 browser->GetSelectedTabContents()->render_view_host()->SetRendererPrefs( | 357 browser->GetSelectedTabContents()->render_view_host()->SetRendererPrefs( |
| 352 browser->GetSelectedTabContents()->delegate()->GetRendererPrefs()); | 358 browser->GetSelectedTabContents()->delegate()->GetRendererPrefs()); |
| 353 browser->window()->Show(); | 359 browser->window()->Show(); |
| 354 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial | 360 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial |
| 355 // focus explicitly. | 361 // focus explicitly. |
| 356 browser->GetSelectedTabContents()->view()->SetInitialFocus(); | 362 browser->GetSelectedTabContents()->view()->SetInitialFocus(); |
| 357 } | 363 } |
| 358 | 364 |
| 359 /////////////////////////////////////////////////////////////////////////////// | 365 /////////////////////////////////////////////////////////////////////////////// |
| 360 // Browser, State Storage and Retrieval for UI: | 366 // Browser, State Storage and Retrieval for UI: |
| (...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2767 /////////////////////////////////////////////////////////////////////////////// | 2773 /////////////////////////////////////////////////////////////////////////////// |
| 2768 // BrowserToolbarModel (private): | 2774 // BrowserToolbarModel (private): |
| 2769 | 2775 |
| 2770 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2776 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2771 // This |current_tab| can be NULL during the initialization of the | 2777 // This |current_tab| can be NULL during the initialization of the |
| 2772 // toolbar during window creation (i.e. before any tabs have been added | 2778 // toolbar during window creation (i.e. before any tabs have been added |
| 2773 // to the window). | 2779 // to the window). |
| 2774 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2780 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2775 return current_tab ? ¤t_tab->controller() : NULL; | 2781 return current_tab ? ¤t_tab->controller() : NULL; |
| 2776 } | 2782 } |
| OLD | NEW |