OLD | NEW |
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_install_prompt.h" | 5 #include "chrome/browser/extensions/extension_install_prompt.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 } | 365 } |
366 | 366 |
367 void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension, | 367 void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension, |
368 SkBitmap* icon) { | 368 SkBitmap* icon) { |
369 extension_ = extension; | 369 extension_ = extension; |
370 SetIcon(icon); | 370 SetIcon(icon); |
371 | 371 |
372 install_ui_->OnInstallSuccess(extension, &icon_); | 372 install_ui_->OnInstallSuccess(extension, &icon_); |
373 } | 373 } |
374 | 374 |
375 void ExtensionInstallPrompt::OnInstallFailure(const CrxInstallerError& error) { | 375 void ExtensionInstallPrompt::OnInstallFailure( |
| 376 const extensions::CrxInstallerError& error) { |
376 install_ui_->OnInstallFailure(error); | 377 install_ui_->OnInstallFailure(error); |
377 } | 378 } |
378 | 379 |
379 void ExtensionInstallPrompt::SetIcon(const SkBitmap* image) { | 380 void ExtensionInstallPrompt::SetIcon(const SkBitmap* image) { |
380 if (image) | 381 if (image) |
381 icon_ = *image; | 382 icon_ = *image; |
382 else | 383 else |
383 icon_ = SkBitmap(); | 384 icon_ = SkBitmap(); |
384 if (icon_.empty()) | 385 if (icon_.empty()) |
385 icon_ = Extension::GetDefaultIcon(extension_->is_app()); | 386 icon_ = Extension::GetDefaultIcon(extension_->is_app()); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 NOTREACHED() << "Unknown message"; | 472 NOTREACHED() << "Unknown message"; |
472 break; | 473 break; |
473 } | 474 } |
474 } | 475 } |
475 | 476 |
476 // static | 477 // static |
477 bool ExtensionInstallPrompt::ShouldAutomaticallyApproveScopes() { | 478 bool ExtensionInstallPrompt::ShouldAutomaticallyApproveScopes() { |
478 return !CommandLine::ForCurrentProcess()->HasSwitch( | 479 return !CommandLine::ForCurrentProcess()->HasSwitch( |
479 switches::kDemandUserScopeApproval); | 480 switches::kDemandUserScopeApproval); |
480 } | 481 } |
OLD | NEW |