| 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 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2338 bool Browser::ShouldShowLocationBar() const { | 2338 bool Browser::ShouldShowLocationBar() const { |
| 2339 // Tabbed browser always show a location bar. | 2339 // Tabbed browser always show a location bar. |
| 2340 if (is_type_tabbed()) | 2340 if (is_type_tabbed()) |
| 2341 return true; | 2341 return true; |
| 2342 | 2342 |
| 2343 // Trusted app windows and system windows never show a location bar. | 2343 // Trusted app windows and system windows never show a location bar. |
| 2344 return !is_app() && !is_trusted_source(); | 2344 return !is_app() && !is_trusted_source(); |
| 2345 } | 2345 } |
| 2346 | 2346 |
| 2347 bool Browser::ShouldUseWebAppFrame() const { | 2347 bool Browser::ShouldUseWebAppFrame() const { |
| 2348 // Only use the web app frame for apps in ash, and only if streamlined hosted | 2348 // Only use the web app frame for apps in ash, and only if bookmark apps are |
| 2349 // apps are enabled. | 2349 // enabled. |
| 2350 if (!is_app() || host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH || | 2350 if (!is_app() || host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH || |
| 2351 !IsWebAppFrameEnabled()) { | 2351 !IsWebAppFrameEnabled()) { |
| 2352 return false; | 2352 return false; |
| 2353 } | 2353 } |
| 2354 | 2354 |
| 2355 // Use the web app frame for hosted apps (which include bookmark apps). | 2355 // Use the web app frame for hosted apps (which include bookmark apps). |
| 2356 const std::string extension_id = | 2356 const std::string extension_id = |
| 2357 web_app::GetExtensionIdFromApplicationName(app_name()); | 2357 web_app::GetExtensionIdFromApplicationName(app_name()); |
| 2358 const extensions::Extension* extension = | 2358 const extensions::Extension* extension = |
| 2359 extensions::ExtensionRegistry::Get(profile_)->GetExtensionById( | 2359 extensions::ExtensionRegistry::Get(profile_)->GetExtensionById( |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2516 if (contents && !allow_js_access) { | 2516 if (contents && !allow_js_access) { |
| 2517 contents->web_contents()->GetController().LoadURL( | 2517 contents->web_contents()->GetController().LoadURL( |
| 2518 target_url, | 2518 target_url, |
| 2519 content::Referrer(), | 2519 content::Referrer(), |
| 2520 ui::PAGE_TRANSITION_LINK, | 2520 ui::PAGE_TRANSITION_LINK, |
| 2521 std::string()); // No extra headers. | 2521 std::string()); // No extra headers. |
| 2522 } | 2522 } |
| 2523 | 2523 |
| 2524 return contents != NULL; | 2524 return contents != NULL; |
| 2525 } | 2525 } |
| OLD | NEW |