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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 381 } |
382 | 382 |
383 void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension, | 383 void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension, |
384 SkBitmap* icon) { | 384 SkBitmap* icon) { |
385 extension_ = extension; | 385 extension_ = extension; |
386 SetIcon(icon); | 386 SetIcon(icon); |
387 | 387 |
388 install_ui_->OnInstallSuccess(extension, &icon_); | 388 install_ui_->OnInstallSuccess(extension, &icon_); |
389 } | 389 } |
390 | 390 |
391 void ExtensionInstallPrompt::OnInstallFailure(const CrxInstallerError& error) { | 391 void ExtensionInstallPrompt::OnInstallFailure( |
| 392 const extensions::CrxInstallerError& error) { |
392 install_ui_->OnInstallFailure(error); | 393 install_ui_->OnInstallFailure(error); |
393 } | 394 } |
394 | 395 |
395 void ExtensionInstallPrompt::SetIcon(const SkBitmap* image) { | 396 void ExtensionInstallPrompt::SetIcon(const SkBitmap* image) { |
396 if (image) | 397 if (image) |
397 icon_ = *image; | 398 icon_ = *image; |
398 else | 399 else |
399 icon_ = SkBitmap(); | 400 icon_ = SkBitmap(); |
400 if (icon_.empty()) | 401 if (icon_.empty()) |
401 icon_ = Extension::GetDefaultIcon(extension_->is_app()); | 402 icon_ = Extension::GetDefaultIcon(extension_->is_app()); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 Browser* browser) { | 503 Browser* browser) { |
503 // |browser| can be NULL in unit tests. | 504 // |browser| can be NULL in unit tests. |
504 if (!browser) | 505 if (!browser) |
505 return new ExtensionInstallPrompt(NULL, NULL, NULL); | 506 return new ExtensionInstallPrompt(NULL, NULL, NULL); |
506 gfx::NativeWindow parent = | 507 gfx::NativeWindow parent = |
507 browser->window() ? browser->window()->GetNativeWindow() : NULL; | 508 browser->window() ? browser->window()->GetNativeWindow() : NULL; |
508 return new ExtensionInstallPrompt(parent, browser, browser->profile()); | 509 return new ExtensionInstallPrompt(parent, browser, browser->profile()); |
509 } | 510 } |
510 | 511 |
511 } // namespace chrome | 512 } // namespace chrome |
OLD | NEW |