| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_view_host.h" | 5 #include "chrome/browser/extensions/extension_view_host.h" |
| 6 | 6 |
| 7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/extension_view.h" | 9 #include "chrome/browser/extensions/extension_view.h" |
| 10 #include "chrome/browser/extensions/window_controller.h" | 10 #include "chrome/browser/extensions/window_controller.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ExtensionViewHost::UnhandledKeyboardEvent( | 93 void ExtensionViewHost::UnhandledKeyboardEvent( |
| 94 WebContents* source, | 94 WebContents* source, |
| 95 const content::NativeWebKeyboardEvent& event) { | 95 const content::NativeWebKeyboardEvent& event) { |
| 96 view_->HandleKeyboardEvent(source, event); | 96 view_->HandleKeyboardEvent(source, event); |
| 97 } | 97 } |
| 98 | 98 |
| 99 // ExtensionHost overrides: | 99 // ExtensionHost overrides: |
| 100 | 100 |
| 101 void ExtensionViewHost::OnDidStopLoading() { | 101 void ExtensionViewHost::OnDidStopFirstLoad() { |
| 102 DCHECK(did_stop_loading()); | |
| 103 view_->DidStopLoading(); | 102 view_->DidStopLoading(); |
| 104 } | 103 } |
| 105 | 104 |
| 106 void ExtensionViewHost::LoadInitialURL() { | 105 void ExtensionViewHost::LoadInitialURL() { |
| 107 if (!ExtensionSystem::Get(browser_context())-> | 106 if (!ExtensionSystem::Get(browser_context())-> |
| 108 runtime_data()->IsBackgroundPageReady(extension())) { | 107 runtime_data()->IsBackgroundPageReady(extension())) { |
| 109 // Make sure the background page loads before any others. | 108 // Make sure the background page loads before any others. |
| 110 registrar_.Add(this, | 109 registrar_.Add(this, |
| 111 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, | 110 extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY, |
| 112 content::Source<Extension>(extension())); | 111 content::Source<Extension>(extension())); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 const content::NotificationSource& source, | 296 const content::NotificationSource& source, |
| 298 const content::NotificationDetails& details) { | 297 const content::NotificationDetails& details) { |
| 299 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); | 298 DCHECK_EQ(type, extensions::NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY); |
| 300 DCHECK(ExtensionSystem::Get(browser_context()) | 299 DCHECK(ExtensionSystem::Get(browser_context()) |
| 301 ->runtime_data() | 300 ->runtime_data() |
| 302 ->IsBackgroundPageReady(extension())); | 301 ->IsBackgroundPageReady(extension())); |
| 303 LoadInitialURL(); | 302 LoadInitialURL(); |
| 304 } | 303 } |
| 305 | 304 |
| 306 } // namespace extensions | 305 } // namespace extensions |
| OLD | NEW |