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

Side by Side Diff: chrome/browser/apps/ephemeral_app_launcher.cc

Issue 309533007: Refactor PermissionsData pt1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest master Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/apps/ephemeral_app_launcher.h" 5 #include "chrome/browser/apps/ephemeral_app_launcher.h"
6 6
7 #include "chrome/browser/extensions/extension_install_prompt.h" 7 #include "chrome/browser/extensions/extension_install_prompt.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_util.h" 9 #include "chrome/browser/extensions/extension_util.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return web_contents() ? web_contents() : dummy_web_contents_.get(); 168 return web_contents() ? web_contents() : dummy_web_contents_.get();
169 } 169 }
170 170
171 scoped_ptr<ExtensionInstallPrompt::Prompt> 171 scoped_ptr<ExtensionInstallPrompt::Prompt>
172 EphemeralAppLauncher::CreateInstallPrompt() const { 172 EphemeralAppLauncher::CreateInstallPrompt() const {
173 DCHECK(extension_.get() != NULL); 173 DCHECK(extension_.get() != NULL);
174 174
175 // Skip the prompt by returning null if the app does not need to display 175 // Skip the prompt by returning null if the app does not need to display
176 // permission warnings. 176 // permission warnings.
177 extensions::PermissionMessages permissions = 177 extensions::PermissionMessages permissions =
178 extensions::PermissionsData::GetPermissionMessages(extension_.get()); 178 extensions::PermissionsData::ForExtension(extension_)
179 ->GetPermissionMessages();
179 if (permissions.empty()) 180 if (permissions.empty())
180 return scoped_ptr<ExtensionInstallPrompt::Prompt>(); 181 return scoped_ptr<ExtensionInstallPrompt::Prompt>();
181 182
182 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt( 183 return make_scoped_ptr(new ExtensionInstallPrompt::Prompt(
183 ExtensionInstallPrompt::LAUNCH_PROMPT)); 184 ExtensionInstallPrompt::LAUNCH_PROMPT));
184 } 185 }
185 186
186 bool EphemeralAppLauncher::CheckInlineInstallPermitted( 187 bool EphemeralAppLauncher::CheckInlineInstallPermitted(
187 const base::DictionaryValue& webstore_data, 188 const base::DictionaryValue& webstore_data,
188 std::string* error) const { 189 std::string* error) const {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 LaunchApp(extension); 275 LaunchApp(extension);
275 WebstoreStandaloneInstaller::CompleteInstall(std::string()); 276 WebstoreStandaloneInstaller::CompleteInstall(std::string());
276 } else { 277 } else {
277 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); 278 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError);
278 } 279 }
279 } 280 }
280 281
281 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { 282 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
282 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); 283 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError);
283 } 284 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698