| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 void OpenURLOffTheRecord(Profile* profile, | 316 void OpenURLOffTheRecord(Profile* profile, |
| 317 const GURL& url, | 317 const GURL& url, |
| 318 chrome::HostDesktopType desktop_type) { | 318 chrome::HostDesktopType desktop_type) { |
| 319 ScopedTabbedBrowserDisplayer displayer(profile->GetOffTheRecordProfile(), | 319 ScopedTabbedBrowserDisplayer displayer(profile->GetOffTheRecordProfile(), |
| 320 desktop_type); | 320 desktop_type); |
| 321 AddSelectedTabWithURL(displayer.browser(), url, | 321 AddSelectedTabWithURL(displayer.browser(), url, |
| 322 content::PAGE_TRANSITION_LINK); | 322 content::PAGE_TRANSITION_LINK); |
| 323 } | 323 } |
| 324 | 324 |
| 325 #if !defined(OS_WIN) |
| 326 HostDesktopType GetVerifiedHostDesktopForBrowser(HostDesktopType desktop_type) { |
| 327 return desktop_type; |
| 328 } |
| 329 #endif // !defined(OS_WIN) |
| 330 |
| 325 bool CanGoBack(const Browser* browser) { | 331 bool CanGoBack(const Browser* browser) { |
| 326 return browser->tab_strip_model()->GetActiveWebContents()-> | 332 return browser->tab_strip_model()->GetActiveWebContents()-> |
| 327 GetController().CanGoBack(); | 333 GetController().CanGoBack(); |
| 328 } | 334 } |
| 329 | 335 |
| 330 void GoBack(Browser* browser, WindowOpenDisposition disposition) { | 336 void GoBack(Browser* browser, WindowOpenDisposition disposition) { |
| 331 content::RecordAction(UserMetricsAction("Back")); | 337 content::RecordAction(UserMetricsAction("Back")); |
| 332 | 338 |
| 333 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); | 339 WebContents* current_tab = browser->tab_strip_model()->GetActiveWebContents(); |
| 334 if (CanGoBack(browser)) { | 340 if (CanGoBack(browser)) { |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), | 1154 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), |
| 1149 browser->host_desktop_type())); | 1155 browser->host_desktop_type())); |
| 1150 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1156 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1151 | 1157 |
| 1152 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1158 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1153 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1159 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1154 app_browser->window()->Show(); | 1160 app_browser->window()->Show(); |
| 1155 } | 1161 } |
| 1156 | 1162 |
| 1157 } // namespace chrome | 1163 } // namespace chrome |
| OLD | NEW |