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_host.h" | 5 #include "chrome/browser/extensions/extension_host.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 if (pm) | 573 if (pm) |
574 pm->DecrementLazyKeepaliveCount(extension()); | 574 pm->DecrementLazyKeepaliveCount(extension()); |
575 } | 575 } |
576 | 576 |
577 void ExtensionHost::OnDetailedConsoleMessageAdded( | 577 void ExtensionHost::OnDetailedConsoleMessageAdded( |
578 const base::string16& message, | 578 const base::string16& message, |
579 const base::string16& source, | 579 const base::string16& source, |
580 const StackTrace& stack_trace, | 580 const StackTrace& stack_trace, |
581 int32 severity_level) { | 581 int32 severity_level) { |
582 if (IsSourceFromAnExtension(source)) { | 582 if (IsSourceFromAnExtension(source)) { |
| 583 GURL context_url; |
| 584 if (associated_web_contents_) |
| 585 context_url = associated_web_contents_->GetLastCommittedURL(); |
| 586 else if (host_contents_.get()) |
| 587 context_url = host_contents_->GetLastCommittedURL(); |
| 588 |
583 ErrorConsole::Get(profile_)->ReportError( | 589 ErrorConsole::Get(profile_)->ReportError( |
584 scoped_ptr<ExtensionError>(new RuntimeError( | 590 scoped_ptr<ExtensionError>(new RuntimeError( |
| 591 extension_id_, |
585 profile_->IsOffTheRecord(), | 592 profile_->IsOffTheRecord(), |
586 source, | 593 source, |
587 message, | 594 message, |
588 stack_trace, | 595 stack_trace, |
589 associated_web_contents_ ? | 596 context_url, |
590 associated_web_contents_->GetLastCommittedURL() : | |
591 GURL::EmptyGURL(), | |
592 static_cast<logging::LogSeverity>(severity_level)))); | 597 static_cast<logging::LogSeverity>(severity_level)))); |
593 } | 598 } |
594 } | 599 } |
595 | 600 |
596 void ExtensionHost::UnhandledKeyboardEvent( | 601 void ExtensionHost::UnhandledKeyboardEvent( |
597 WebContents* source, | 602 WebContents* source, |
598 const content::NativeWebKeyboardEvent& event) { | 603 const content::NativeWebKeyboardEvent& event) { |
599 Browser* browser = view() ? view()->browser() : NULL; | 604 Browser* browser = view() ? view()->browser() : NULL; |
600 if (browser) { | 605 if (browser) { |
601 // Handle lower priority browser shortcuts such as Ctrl-f. | 606 // Handle lower priority browser shortcuts such as Ctrl-f. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 | 699 |
695 void ExtensionHost::RequestMediaAccessPermission( | 700 void ExtensionHost::RequestMediaAccessPermission( |
696 content::WebContents* web_contents, | 701 content::WebContents* web_contents, |
697 const content::MediaStreamRequest& request, | 702 const content::MediaStreamRequest& request, |
698 const content::MediaResponseCallback& callback) { | 703 const content::MediaResponseCallback& callback) { |
699 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( | 704 MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( |
700 web_contents, request, callback, extension()); | 705 web_contents, request, callback, extension()); |
701 } | 706 } |
702 | 707 |
703 } // namespace extensions | 708 } // namespace extensions |
OLD | NEW |