| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 OpenEmptyWindow(profile->GetOriginalProfile(), desktop_type); | 299 OpenEmptyWindow(profile->GetOriginalProfile(), desktop_type); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 void NewEmptyWindow(Profile* profile) { | 304 void NewEmptyWindow(Profile* profile) { |
| 305 NewEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE); | 305 NewEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE); |
| 306 } | 306 } |
| 307 | 307 |
| 308 Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) { | 308 Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) { |
| 309 // TODO(scottmg): http://crbug.com/128578 |
| 310 // This is necessary because WebContentsViewAura doesn't have enough context |
| 311 // to get the right StackingClient (and therefore parent window) otherwise. |
| 312 ScopedForceDesktopType force_desktop_type(desktop_type); |
| 309 Browser* browser = new Browser( | 313 Browser* browser = new Browser( |
| 310 Browser::CreateParams(Browser::TYPE_TABBED, profile, desktop_type)); | 314 Browser::CreateParams(Browser::TYPE_TABBED, profile, desktop_type)); |
| 311 AddBlankTabAt(browser, -1, true); | 315 AddBlankTabAt(browser, -1, true); |
| 312 browser->window()->Show(); | 316 browser->window()->Show(); |
| 313 return browser; | 317 return browser; |
| 314 } | 318 } |
| 315 | 319 |
| 316 Browser* OpenEmptyWindow(Profile* profile) { | 320 Browser* OpenEmptyWindow(Profile* profile) { |
| 317 return OpenEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE); | 321 return OpenEmptyWindow(profile, HOST_DESKTOP_TYPE_NATIVE); |
| 318 } | 322 } |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 BrowserCommandsTabContentsCreator::CreateTabContents(contents); | 1088 BrowserCommandsTabContentsCreator::CreateTabContents(contents); |
| 1085 } | 1089 } |
| 1086 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 1090 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
| 1087 | 1091 |
| 1088 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1092 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1089 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1093 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1090 app_browser->window()->Show(); | 1094 app_browser->window()->Show(); |
| 1091 } | 1095 } |
| 1092 | 1096 |
| 1093 } // namespace chrome | 1097 } // namespace chrome |
| OLD | NEW |