| 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.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2298 } | 2298 } |
| 2299 } | 2299 } |
| 2300 | 2300 |
| 2301 bool Browser::ShouldShowLocationBar() const { | 2301 bool Browser::ShouldShowLocationBar() const { |
| 2302 // Tabbed browser always show a location bar. | 2302 // Tabbed browser always show a location bar. |
| 2303 if (is_type_tabbed()) | 2303 if (is_type_tabbed()) |
| 2304 return true; | 2304 return true; |
| 2305 | 2305 |
| 2306 if (is_app()) { | 2306 if (is_app()) { |
| 2307 if (CommandLine::ForCurrentProcess()->HasSwitch( | 2307 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 2308 switches::kEnableStreamlinedHostedApps)) { | 2308 switches::kEnableStreamlinedHostedApps) && |
| 2309 host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH) { |
| 2309 // If kEnableStreamlinedHostedApps is true, show the location bar for | 2310 // If kEnableStreamlinedHostedApps is true, show the location bar for |
| 2310 // bookmark apps. | 2311 // bookmark apps, except on ash which has the toolbar merged into the |
| 2312 // frame. |
| 2311 ExtensionService* service = | 2313 ExtensionService* service = |
| 2312 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 2314 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 2313 const extensions::Extension* extension = | 2315 const extensions::Extension* extension = |
| 2314 service ? service->GetInstalledExtension( | 2316 service ? service->GetInstalledExtension( |
| 2315 web_app::GetExtensionIdFromApplicationName(app_name())) | 2317 web_app::GetExtensionIdFromApplicationName(app_name())) |
| 2316 : NULL; | 2318 : NULL; |
| 2317 return (!extension || extension->from_bookmark()) && | 2319 return (!extension || extension->from_bookmark()) && |
| 2318 app_name() != DevToolsWindow::kDevToolsApp; | 2320 app_name() != DevToolsWindow::kDevToolsApp; |
| 2319 } else { | 2321 } else { |
| 2320 return false; | 2322 return false; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 if (contents && !allow_js_access) { | 2476 if (contents && !allow_js_access) { |
| 2475 contents->web_contents()->GetController().LoadURL( | 2477 contents->web_contents()->GetController().LoadURL( |
| 2476 target_url, | 2478 target_url, |
| 2477 content::Referrer(), | 2479 content::Referrer(), |
| 2478 content::PAGE_TRANSITION_LINK, | 2480 content::PAGE_TRANSITION_LINK, |
| 2479 std::string()); // No extra headers. | 2481 std::string()); // No extra headers. |
| 2480 } | 2482 } |
| 2481 | 2483 |
| 2482 return contents != NULL; | 2484 return contents != NULL; |
| 2483 } | 2485 } |
| OLD | NEW |