summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/toolbar_view.cc
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-16 10:29:05 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-16 10:29:05 +0000
commit0ecb16ee408ccafe7639bec150629b25b51f18a6 (patch)
treeefd59c0f01406c30f98eb475209a506b97072654 /chrome/browser/ui/views/toolbar_view.cc
parentf12e186c5aa339a24d48d71045afe0b11fbb714b (diff)
downloadchromium_src-0ecb16ee408ccafe7639bec150629b25b51f18a6.zip
chromium_src-0ecb16ee408ccafe7639bec150629b25b51f18a6.tar.gz
chromium_src-0ecb16ee408ccafe7639bec150629b25b51f18a6.tar.bz2
Make hosted app windows enable the toolbar for streamlined hosted apps.
The work in this CL is behind the enable-streamlined-hosted-apps flag. This CL enables the toolbar for hosted apps. In order to do this, the BrowserNonClientViews were made to handle having the toolbar without the tabstrip. BUG= Review URL: https://codereview.chromium.org/26856003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/views/toolbar_view.cc')
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index 20e8156..8ac94c0 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/toolbar_view.h"
+#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/i18n/number_formatting.h"
#include "base/prefs/pref_service.h"
@@ -35,6 +36,7 @@
#include "chrome/browser/ui/views/wrench_menu.h"
#include "chrome/browser/ui/views/wrench_toolbar_button.h"
#include "chrome/browser/upgrade_detector.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/notification_service.h"
@@ -100,6 +102,11 @@ int GetButtonSpacing() {
ToolbarView::kStandardSpacing : 0;
}
+bool IsStreamlinedHostedAppsEnabled() {
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableStreamlinedHostedApps);
+}
+
} // namespace
// static
@@ -131,8 +138,10 @@ ToolbarView::ToolbarView(Browser* browser)
chrome::AddCommandObserver(browser_, IDC_HOME, this);
chrome::AddCommandObserver(browser_, IDC_LOAD_NEW_TAB_PAGE, this);
- display_mode_ = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) ?
- DISPLAYMODE_NORMAL : DISPLAYMODE_LOCATION;
+ display_mode_ = DISPLAYMODE_LOCATION;
+ if (browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP) ||
+ (browser->is_app() && IsStreamlinedHostedAppsEnabled()))
+ display_mode_ = DISPLAYMODE_NORMAL;
registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
content::NotificationService::AllSources());
@@ -187,7 +196,8 @@ void ToolbarView::Init() {
location_bar_ = new LocationBarView(
browser_, browser_->profile(),
browser_->command_controller()->command_updater(), this,
- display_mode_ == DISPLAYMODE_LOCATION);
+ display_mode_ == DISPLAYMODE_LOCATION ||
+ (browser_->is_app() && IsStreamlinedHostedAppsEnabled()));
reload_ = new ReloadButton(location_bar_,
browser_->command_controller()->command_updater());
@@ -634,6 +644,10 @@ bool ToolbarView::IsWrenchMenuShowing() const {
return wrench_menu_.get() && wrench_menu_->IsShowing();
}
+bool ToolbarView::ShouldPaintBackground() const {
+ return display_mode_ == DISPLAYMODE_NORMAL;
+}
+
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, protected: