| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/hosted_app_browser_controller.h" | 5 #include "chrome/browser/ui/extensions/hosted_app_browser_controller.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ssl/connection_security.h" | 9 #include "chrome/browser/ssl/connection_security.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 HostedAppBrowserController::HostedAppBrowserController(Browser* browser) | 54 HostedAppBrowserController::HostedAppBrowserController(Browser* browser) |
| 55 : browser_(browser), | 55 : browser_(browser), |
| 56 extension_id_( | 56 extension_id_( |
| 57 web_app::GetExtensionIdFromApplicationName(browser->app_name())) { | 57 web_app::GetExtensionIdFromApplicationName(browser->app_name())) { |
| 58 const Extension* extension = | 58 const Extension* extension = |
| 59 ExtensionRegistry::Get(browser->profile())->GetExtensionById( | 59 ExtensionRegistry::Get(browser->profile())->GetExtensionById( |
| 60 extension_id_, ExtensionRegistry::EVERYTHING); | 60 extension_id_, ExtensionRegistry::EVERYTHING); |
| 61 DCHECK(extension); | 61 DCHECK(extension); |
| 62 should_use_web_app_frame_ = | 62 should_use_web_app_frame_ = |
| 63 extension->from_bookmark() && | 63 extension->from_bookmark() && |
| 64 browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH && | 64 browser->host_desktop_type() == ui::HOST_DESKTOP_TYPE_ASH && |
| 65 IsWebAppFrameEnabled(); | 65 IsWebAppFrameEnabled(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 HostedAppBrowserController::~HostedAppBrowserController() { | 68 HostedAppBrowserController::~HostedAppBrowserController() { |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool HostedAppBrowserController::SupportsLocationBar() const { | 71 bool HostedAppBrowserController::SupportsLocationBar() const { |
| 72 return !should_use_web_app_frame(); | 72 return !should_use_web_app_frame(); |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void HostedAppBrowserController::UpdateLocationBarVisibility( | 107 void HostedAppBrowserController::UpdateLocationBarVisibility( |
| 108 bool animate) const { | 108 bool animate) const { |
| 109 if (!SupportsLocationBar()) | 109 if (!SupportsLocationBar()) |
| 110 return; | 110 return; |
| 111 | 111 |
| 112 browser_->window()->GetLocationBar()->UpdateLocationBarVisibility( | 112 browser_->window()->GetLocationBar()->UpdateLocationBarVisibility( |
| 113 ShouldShowLocationBar(), animate); | 113 ShouldShowLocationBar(), animate); |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace extensions | 116 } // namespace extensions |
| OLD | NEW |