| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 // See http://code.google.com/p/chromium/issues/detail?id=18240 | 705 // See http://code.google.com/p/chromium/issues/detail?id=18240 |
| 706 LOG(INFO) << "(RenderViewCreated) Resetting EFD to " << url_.spec() << " for " | 706 LOG(INFO) << "(RenderViewCreated) Resetting EFD to " << url_.spec() << " for " |
| 707 << extension_->name(); | 707 << extension_->name(); |
| 708 extension_function_dispatcher_.reset( | 708 extension_function_dispatcher_.reset( |
| 709 ExtensionFunctionDispatcher::Create(render_view_host, this, url_)); | 709 ExtensionFunctionDispatcher::Create(render_view_host, this, url_)); |
| 710 | 710 |
| 711 if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP || | 711 if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP || |
| 712 extension_host_type_ == ViewType::EXTENSION_MOLE || | 712 extension_host_type_ == ViewType::EXTENSION_MOLE || |
| 713 extension_host_type_ == ViewType::EXTENSION_POPUP || | 713 extension_host_type_ == ViewType::EXTENSION_POPUP || |
| 714 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { | 714 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { |
| 715 render_view_host->EnablePreferredSizeChangedMode(); | 715 render_view_host->EnablePreferredSizeChangedMode( |
| 716 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); |
| 716 } | 717 } |
| 717 } | 718 } |
| 718 | 719 |
| 719 int ExtensionHost::GetBrowserWindowID() const { | 720 int ExtensionHost::GetBrowserWindowID() const { |
| 720 // Hosts not attached to any browser window have an id of -1. This includes | 721 // Hosts not attached to any browser window have an id of -1. This includes |
| 721 // those mentioned below, and background pages. | 722 // those mentioned below, and background pages. |
| 722 int window_id = extension_misc::kUnknownWindowId; | 723 int window_id = extension_misc::kUnknownWindowId; |
| 723 if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP || | 724 if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP || |
| 724 extension_host_type_ == ViewType::EXTENSION_MOLE || | 725 extension_host_type_ == ViewType::EXTENSION_MOLE || |
| 725 extension_host_type_ == ViewType::EXTENSION_POPUP || | 726 extension_host_type_ == ViewType::EXTENSION_POPUP || |
| 726 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { | 727 extension_host_type_ == ViewType::EXTENSION_INFOBAR) { |
| 727 // If the host is bound to a browser, then extract its window id. | 728 // If the host is bound to a browser, then extract its window id. |
| 728 // Extensions hosted in ExternalTabContainer objects may not have | 729 // Extensions hosted in ExternalTabContainer objects may not have |
| 729 // an associated browser. | 730 // an associated browser. |
| 730 Browser* browser = GetBrowser(); | 731 Browser* browser = GetBrowser(); |
| 731 if (browser) | 732 if (browser) |
| 732 window_id = ExtensionTabUtil::GetWindowId(browser); | 733 window_id = ExtensionTabUtil::GetWindowId(browser); |
| 733 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { | 734 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 734 NOTREACHED(); | 735 NOTREACHED(); |
| 735 } | 736 } |
| 736 return window_id; | 737 return window_id; |
| 737 } | 738 } |
| OLD | NEW |