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

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

Issue 12943010: Add native permissions dialog for apps_devtools app. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 7 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 (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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 const Extension* extension) { 562 const Extension* extension) {
563 DCHECK(ui_loop_ == MessageLoop::current()); 563 DCHECK(ui_loop_ == MessageLoop::current());
564 extension_ = extension; 564 extension_ = extension;
565 permissions_ = extension->GetActivePermissions(); 565 permissions_ = extension->GetActivePermissions();
566 delegate_ = delegate; 566 delegate_ = delegate;
567 prompt_.set_type(POST_INSTALL_PERMISSIONS_PROMPT); 567 prompt_.set_type(POST_INSTALL_PERMISSIONS_PROMPT);
568 568
569 LoadImageIfNeeded(); 569 LoadImageIfNeeded();
570 } 570 }
571 571
572 void ExtensionInstallPrompt::PermissionsDialog(Delegate* delegate,
573 const Extension* extension) {
574 DCHECK(ui_loop_ == MessageLoop::current());
575 extension_ = extension;
576 permissions_ = extension->GetActivePermissions();
577 delegate_ = delegate;
578 prompt_.set_type(POST_INSTALL_PERMISSIONS_PROMPT);
579
580 // TODO(grv): Load extension icon.
581 SetIcon(NULL);
582 FetchOAuthIssueAdviceIfNeeded();
583 }
584
572 void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension, 585 void ExtensionInstallPrompt::OnInstallSuccess(const Extension* extension,
573 SkBitmap* icon) { 586 SkBitmap* icon) {
574 extension_ = extension; 587 extension_ = extension;
575 SetIcon(icon); 588 SetIcon(icon);
576 589
577 install_ui_->OnInstallSuccess(extension, &icon_); 590 install_ui_->OnInstallSuccess(extension, &icon_);
578 } 591 }
579 592
580 void ExtensionInstallPrompt::OnInstallFailure( 593 void ExtensionInstallPrompt::OnInstallFailure(
581 const extensions::CrxInstallerError& error) { 594 const extensions::CrxInstallerError& error) {
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 } 711 }
699 712
700 if (AutoConfirmPrompt(delegate_)) 713 if (AutoConfirmPrompt(delegate_))
701 return; 714 return;
702 715
703 if (show_dialog_callback_.is_null()) 716 if (show_dialog_callback_.is_null())
704 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_); 717 GetDefaultShowDialogCallback().Run(show_params_, delegate_, prompt_);
705 else 718 else
706 show_dialog_callback_.Run(show_params_, delegate_, prompt_); 719 show_dialog_callback_.Run(show_params_, delegate_, prompt_);
707 } 720 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698