[sql] Remove _HAS_EXCEPTIONS=0 from build info.
[chromium-blink-merge.git] / chrome / browser / banners / app_banner_manager_desktop.cc
blob8b48afe02ad675c3872eb29fc818b2cee4367fe5
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
3 // found in the LICENSE file.
5 #include "chrome/browser/banners/app_banner_manager_desktop.h"
7 #include "base/command_line.h"
8 #include "chrome/browser/banners/app_banner_data_fetcher_desktop.h"
9 #include "chrome/common/chrome_switches.h"
10 #include "extensions/common/constants.h"
12 namespace {
13 // TODO(dominickn) Enforce the set of icons which will guarantee the best
14 // user experience.
15 int kMinimumIconSize = extension_misc::EXTENSION_ICON_LARGE;
16 } // anonymous namespace
18 DEFINE_WEB_CONTENTS_USER_DATA_KEY(banners::AppBannerManagerDesktop);
20 namespace banners {
22 bool AppBannerManagerDesktop::IsEnabled() {
23 #if defined(OS_CHROMEOS)
24 return !base::CommandLine::ForCurrentProcess()->HasSwitch(
25 switches::kDisableAddToShelf);
26 #else
27 return base::CommandLine::ForCurrentProcess()->HasSwitch(
28 switches::kEnableAddToShelf);
29 #endif
32 AppBannerDataFetcher* AppBannerManagerDesktop::CreateAppBannerDataFetcher(
33 base::WeakPtr<AppBannerDataFetcher::Delegate> weak_delegate,
34 const int ideal_icon_size) {
35 return new AppBannerDataFetcherDesktop(web_contents(), weak_delegate,
36 ideal_icon_size);
39 AppBannerManagerDesktop::AppBannerManagerDesktop(
40 content::WebContents* web_contents)
41 : AppBannerManager(web_contents, kMinimumIconSize) {
44 } // namespace banners