| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 UMA_HISTOGRAM_TIMES("Extensions.PopupLoadTime", | 348 UMA_HISTOGRAM_TIMES("Extensions.PopupLoadTime", |
| 349 since_created_.Elapsed()); | 349 since_created_.Elapsed()); |
| 350 } else if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP) { | 350 } else if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP) { |
| 351 UMA_HISTOGRAM_TIMES("Extensions.ToolstripLoadTime", | 351 UMA_HISTOGRAM_TIMES("Extensions.ToolstripLoadTime", |
| 352 since_created_.Elapsed()); | 352 since_created_.Elapsed()); |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 | 356 |
| 357 void ExtensionHost::DocumentAvailableInMainFrame(RenderViewHost* rvh) { | 357 void ExtensionHost::DocumentAvailableInMainFrame(RenderViewHost* rvh) { |
| 358 // If the document has already been marked as available for this host, then |
| 359 // bail. No need for the redundant setup. http://crbug.com/31170 |
| 360 if (document_element_available_) |
| 361 return; |
| 362 |
| 358 document_element_available_ = true; | 363 document_element_available_ = true; |
| 359 if (is_background_page()) { | 364 if (is_background_page()) { |
| 360 extension_->SetBackgroundPageReady(); | 365 extension_->SetBackgroundPageReady(); |
| 361 } else { | 366 } else { |
| 362 InsertThemeCSS(); | 367 InsertThemeCSS(); |
| 363 | 368 |
| 364 // Listen for browser changes so we can resend the CSS. | 369 // Listen for browser changes so we can resend the CSS. |
| 365 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 370 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, |
| 366 NotificationService::AllSources()); | 371 NotificationService::AllSources()); |
| 367 } | 372 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 // Extensions hosted in ExternalTabContainer objects may not have | 630 // Extensions hosted in ExternalTabContainer objects may not have |
| 626 // an associated browser. | 631 // an associated browser. |
| 627 Browser* browser = GetBrowser(); | 632 Browser* browser = GetBrowser(); |
| 628 if (browser) | 633 if (browser) |
| 629 window_id = ExtensionTabUtil::GetWindowId(browser); | 634 window_id = ExtensionTabUtil::GetWindowId(browser); |
| 630 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { | 635 } else if (extension_host_type_ != ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 631 NOTREACHED(); | 636 NOTREACHED(); |
| 632 } | 637 } |
| 633 return window_id; | 638 return window_id; |
| 634 } | 639 } |
| OLD | NEW |