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

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

Issue 1004123003: Extensions: Switch to new permission message system, part III (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permissions_tests
Patch Set: Mac Created 5 years, 9 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 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_install_checker.h" 9 #include "chrome/browser/extensions/extension_install_checker.h"
10 #include "chrome/browser/extensions/extension_install_prompt.h" 10 #include "chrome/browser/extensions/extension_install_prompt.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 return web_contents() ? web_contents() : dummy_web_contents_.get(); 386 return web_contents() ? web_contents() : dummy_web_contents_.get();
387 } 387 }
388 388
389 scoped_refptr<ExtensionInstallPrompt::Prompt> 389 scoped_refptr<ExtensionInstallPrompt::Prompt>
390 EphemeralAppLauncher::CreateInstallPrompt() const { 390 EphemeralAppLauncher::CreateInstallPrompt() const {
391 const Extension* extension = localized_extension_for_display(); 391 const Extension* extension = localized_extension_for_display();
392 DCHECK(extension); // Checked in OnManifestParsed(). 392 DCHECK(extension); // Checked in OnManifestParsed().
393 393
394 // Skip the prompt by returning null if the app does not need to display 394 // Skip the prompt by returning null if the app does not need to display
395 // permission warnings. 395 // permission warnings.
396 if (extension->permissions_data()->GetLegacyPermissionMessageStrings() 396 if (extension->permissions_data()->GetPermissionMessageStrings().empty())
397 .empty())
398 return NULL; 397 return NULL;
399 398
400 return make_scoped_refptr(new ExtensionInstallPrompt::Prompt( 399 return make_scoped_refptr(new ExtensionInstallPrompt::Prompt(
401 ExtensionInstallPrompt::LAUNCH_PROMPT)); 400 ExtensionInstallPrompt::LAUNCH_PROMPT));
402 } 401 }
403 402
404 bool EphemeralAppLauncher::CheckInlineInstallPermitted( 403 bool EphemeralAppLauncher::CheckInlineInstallPermitted(
405 const base::DictionaryValue& webstore_data, 404 const base::DictionaryValue& webstore_data,
406 std::string* error) const { 405 std::string* error) const {
407 *error = ""; 406 *error = "";
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 467
469 // CompleteInstall will call Release. 468 // CompleteInstall will call Release.
470 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, 469 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS,
471 std::string()); 470 std::string());
472 } 471 }
473 472
474 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { 473 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
475 // CompleteInstall will call Release. 474 // CompleteInstall will call Release.
476 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); 475 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError);
477 } 476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698