| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/idle_timer.h" | 8 #include "base/idle_timer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 #include "chrome/browser/automation/ui_controls.h" | 61 #include "chrome/browser/automation/ui_controls.h" |
| 62 #include "chrome/browser/browser_process.h" | 62 #include "chrome/browser/browser_process.h" |
| 63 #include "chrome/browser/browser_url_handler.h" | 63 #include "chrome/browser/browser_url_handler.h" |
| 64 #include "chrome/browser/cert_store.h" | 64 #include "chrome/browser/cert_store.h" |
| 65 #include "chrome/browser/debugger/debugger_window.h" | 65 #include "chrome/browser/debugger/debugger_window.h" |
| 66 #include "chrome/browser/dock_info.h" | 66 #include "chrome/browser/dock_info.h" |
| 67 #include "chrome/browser/download/save_package.h" | 67 #include "chrome/browser/download/save_package.h" |
| 68 #include "chrome/browser/options_window.h" | 68 #include "chrome/browser/options_window.h" |
| 69 #include "chrome/browser/ssl/ssl_error_info.h" | 69 #include "chrome/browser/ssl/ssl_error_info.h" |
| 70 #include "chrome/browser/tab_contents/web_contents_view.h" | |
| 71 #include "chrome/browser/task_manager.h" | 70 #include "chrome/browser/task_manager.h" |
| 72 #include "chrome/browser/user_data_manager.h" | 71 #include "chrome/browser/user_data_manager.h" |
| 73 #include "chrome/browser/view_ids.h" | 72 #include "chrome/browser/view_ids.h" |
| 74 #include "chrome/browser/views/location_bar_view.h" | 73 #include "chrome/browser/views/location_bar_view.h" |
| 75 #include "chrome/browser/window_sizer.h" | 74 #include "chrome/browser/window_sizer.h" |
| 76 #include "chrome/common/child_process_host.h" | 75 #include "chrome/common/child_process_host.h" |
| 77 #include "chrome/common/win_util.h" | 76 #include "chrome/common/win_util.h" |
| 78 | 77 |
| 79 #endif // OS_WIN | 78 #endif // OS_WIN |
| 80 | 79 |
| (...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 if (current_tab) { | 1660 if (current_tab) { |
| 1662 const WebContents* const web_contents = current_tab->AsWebContents(); | 1661 const WebContents* const web_contents = current_tab->AsWebContents(); |
| 1663 if (web_contents) { | 1662 if (web_contents) { |
| 1664 const GURL& current_url = web_contents->GetURL(); | 1663 const GURL& current_url = web_contents->GetURL(); |
| 1665 if (SiteInstance::IsSameWebSite(current_url, url)) | 1664 if (SiteInstance::IsSameWebSite(current_url, url)) |
| 1666 instance = web_contents->GetSiteInstance(); | 1665 instance = web_contents->GetSiteInstance(); |
| 1667 } | 1666 } |
| 1668 } | 1667 } |
| 1669 } | 1668 } |
| 1670 | 1669 |
| 1671 // If this is an application we can only have one tab so a new tab always | 1670 // If this is not a normal window (such as a popup or an application), we can |
| 1672 // goes into a tabbed browser window. | 1671 // only have one tab so a new tab always goes into a tabbed browser window. |
| 1673 if (disposition != NEW_WINDOW && type_ & TYPE_APP) { | 1672 if (disposition != NEW_WINDOW && type_ != TYPE_NORMAL) { |
| 1674 // If the disposition is OFF_THE_RECORD we don't want to create a new | 1673 // If the disposition is OFF_THE_RECORD we don't want to create a new |
| 1675 // browser that will itself create another OTR browser. This will result in | 1674 // browser that will itself create another OTR browser. This will result in |
| 1676 // a browser leak (and crash below because no tab is created or selected). | 1675 // a browser leak (and crash below because no tab is created or selected). |
| 1677 if (disposition == OFF_THE_RECORD) { | 1676 if (disposition == OFF_THE_RECORD) { |
| 1678 OpenURLOffTheRecord(profile_, url); | 1677 OpenURLOffTheRecord(profile_, url); |
| 1679 return; | 1678 return; |
| 1680 } | 1679 } |
| 1681 | 1680 |
| 1682 Browser* b = GetOrCreateTabbedBrowser(); | 1681 Browser* b = GetOrCreateTabbedBrowser(); |
| 1683 DCHECK(b); | 1682 DCHECK(b); |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 | 2614 |
| 2616 // We need to register the window position pref. | 2615 // We need to register the window position pref. |
| 2617 std::wstring window_pref(prefs::kBrowserWindowPlacement); | 2616 std::wstring window_pref(prefs::kBrowserWindowPlacement); |
| 2618 window_pref.append(L"_"); | 2617 window_pref.append(L"_"); |
| 2619 window_pref.append(app_name); | 2618 window_pref.append(app_name); |
| 2620 PrefService* prefs = g_browser_process->local_state(); | 2619 PrefService* prefs = g_browser_process->local_state(); |
| 2621 DCHECK(prefs); | 2620 DCHECK(prefs); |
| 2622 | 2621 |
| 2623 prefs->RegisterDictionaryPref(window_pref.c_str()); | 2622 prefs->RegisterDictionaryPref(window_pref.c_str()); |
| 2624 } | 2623 } |
| OLD | NEW |