Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc

Issue 1415333002: [Media Router] Add experiment control logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed msw@'s comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/toolbar/component_toolbar_actions_factory.h" 5 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/toolbar/media_router_action.h" 11 #include "chrome/browser/ui/toolbar/media_router_action.h"
12 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 12 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "extensions/common/feature_switch.h" 14 #include "extensions/common/feature_switch.h"
15 15
16 #if defined(ENABLE_MEDIA_ROUTER)
17 #include "chrome/browser/media/router/media_router_feature.h"
18 #endif
19
16 namespace { 20 namespace {
17 21
18 ComponentToolbarActionsFactory* testing_factory_ = nullptr; 22 ComponentToolbarActionsFactory* testing_factory_ = nullptr;
19 23
20 base::LazyInstance<ComponentToolbarActionsFactory> lazy_factory = 24 base::LazyInstance<ComponentToolbarActionsFactory> lazy_factory =
21 LAZY_INSTANCE_INITIALIZER; 25 LAZY_INSTANCE_INITIALIZER;
22 26
23 } // namespace 27 } // namespace
24 28
25 // static 29 // static
(...skipping 10 matching lines...) Expand all
36 40
37 std::set<std::string> ComponentToolbarActionsFactory::GetComponentIds( 41 std::set<std::string> ComponentToolbarActionsFactory::GetComponentIds(
38 Profile* profile) { 42 Profile* profile) {
39 std::set<std::string> component_ids; 43 std::set<std::string> component_ids;
40 44
41 // This is currently behind the extension-action-redesign flag, as it is 45 // This is currently behind the extension-action-redesign flag, as it is
42 // designed for the new toolbar. 46 // designed for the new toolbar.
43 if (!extensions::FeatureSwitch::extension_action_redesign()->IsEnabled()) 47 if (!extensions::FeatureSwitch::extension_action_redesign()->IsEnabled())
44 return component_ids; 48 return component_ids;
45 49
46 if (switches::MediaRouterEnabled() && !profile->IsOffTheRecord()) 50 #if defined(ENABLE_MEDIA_ROUTER)
51 if (media_router::MediaRouterEnabled() && !profile->IsOffTheRecord())
47 component_ids.insert(kMediaRouterActionId); 52 component_ids.insert(kMediaRouterActionId);
53 #endif // defined(ENABLE_MEDIA_ROUTER)
48 54
49 return component_ids; 55 return component_ids;
50 } 56 }
51 57
52 scoped_ptr<ToolbarActionViewController> 58 scoped_ptr<ToolbarActionViewController>
53 ComponentToolbarActionsFactory::GetComponentToolbarActionForId( 59 ComponentToolbarActionsFactory::GetComponentToolbarActionForId(
54 const std::string& id, 60 const std::string& id,
55 Browser* browser) { 61 Browser* browser) {
56 // This is currently behind the extension-action-redesign flag, as it is 62 // This is currently behind the extension-action-redesign flag, as it is
57 // designed for the new toolbar. 63 // designed for the new toolbar.
(...skipping 12 matching lines...) Expand all
70 76
71 NOTREACHED(); 77 NOTREACHED();
72 return scoped_ptr<ToolbarActionViewController>(); 78 return scoped_ptr<ToolbarActionViewController>();
73 } 79 }
74 80
75 // static 81 // static
76 void ComponentToolbarActionsFactory::SetTestingFactory( 82 void ComponentToolbarActionsFactory::SetTestingFactory(
77 ComponentToolbarActionsFactory* factory) { 83 ComponentToolbarActionsFactory* factory) {
78 testing_factory_ = factory; 84 testing_factory_ = factory;
79 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698