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

Side by Side Diff: chrome/browser/extensions/extension_action_manager.cc

Issue 1549233002: Convert Pass()→std::move() in //chrome/browser/extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 12 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/extensions/extension_action_manager.h" 5 #include "chrome/browser/extensions/extension_action_manager.h"
6 6
7 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r_factory.h" 7 #include "chrome/browser/extensions/api/system_indicator/system_indicator_manage r_factory.h"
8 #include "chrome/browser/extensions/extension_action.h" 8 #include "chrome/browser/extensions/extension_action.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 const ActionInfo* info = ActionInfo::GetBrowserActionInfo(&extension); 138 const ActionInfo* info = ActionInfo::GetBrowserActionInfo(&extension);
139 if (!info) 139 if (!info)
140 info = ActionInfo::GetPageActionInfo(&extension); 140 info = ActionInfo::GetPageActionInfo(&extension);
141 141
142 // Create a new ExtensionAction of |type| with |extension|'s ActionInfo. 142 // Create a new ExtensionAction of |type| with |extension|'s ActionInfo.
143 // If no ActionInfo exists for |extension|, create and return a new action 143 // If no ActionInfo exists for |extension|, create and return a new action
144 // with a blank ActionInfo. 144 // with a blank ActionInfo.
145 // Populate any missing values from |extension|'s manifest. 145 // Populate any missing values from |extension|'s manifest.
146 scoped_ptr<ExtensionAction> new_action(new ExtensionAction( 146 scoped_ptr<ExtensionAction> new_action(new ExtensionAction(
147 extension, type, info ? *info : ActionInfo())); 147 extension, type, info ? *info : ActionInfo()));
148 return new_action.Pass(); 148 return new_action;
149 } 149 }
150 150
151 ExtensionAction* ExtensionActionManager::GetSystemIndicator( 151 ExtensionAction* ExtensionActionManager::GetSystemIndicator(
152 const Extension& extension) const { 152 const Extension& extension) const {
153 // If it does not already exist, create the SystemIndicatorManager for the 153 // If it does not already exist, create the SystemIndicatorManager for the
154 // given profile. This could return NULL if the system indicator area is 154 // given profile. This could return NULL if the system indicator area is
155 // unavailable on the current system. If so, return NULL to signal that 155 // unavailable on the current system. If so, return NULL to signal that
156 // the system indicator area is unusable. 156 // the system indicator area is unusable.
157 if (!SystemIndicatorManagerFactory::GetForProfile(profile_)) 157 if (!SystemIndicatorManagerFactory::GetForProfile(profile_))
158 return NULL; 158 return NULL;
159 159
160 return GetOrCreateOrNull(&system_indicators_, extension, 160 return GetOrCreateOrNull(&system_indicators_, extension,
161 ActionInfo::TYPE_SYSTEM_INDICATOR, 161 ActionInfo::TYPE_SYSTEM_INDICATOR,
162 ActionInfo::GetSystemIndicatorInfo(&extension), 162 ActionInfo::GetSystemIndicatorInfo(&extension),
163 profile_); 163 profile_);
164 } 164 }
165 165
166 ExtensionAction* ExtensionActionManager::GetExtensionAction( 166 ExtensionAction* ExtensionActionManager::GetExtensionAction(
167 const Extension& extension) const { 167 const Extension& extension) const {
168 ExtensionAction* action = GetBrowserAction(extension); 168 ExtensionAction* action = GetBrowserAction(extension);
169 return action ? action : GetPageAction(extension); 169 return action ? action : GetPageAction(extension);
170 } 170 }
171 171
172 } // namespace extensions 172 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698