| 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 // a toolstrip or background_page onload chrome.tabs api call can make it | 478 // a toolstrip or background_page onload chrome.tabs api call can make it |
| 479 // into here before the browser is sufficiently initialized to return here. | 479 // into here before the browser is sufficiently initialized to return here. |
| 480 // A similar situation may arise during shutdown. | 480 // A similar situation may arise during shutdown. |
| 481 // TODO(rafaelw): Delay creation of background_page until the browser | 481 // TODO(rafaelw): Delay creation of background_page until the browser |
| 482 // is available. http://code.google.com/p/chromium/issues/detail?id=13284 | 482 // is available. http://code.google.com/p/chromium/issues/detail?id=13284 |
| 483 return browser; | 483 return browser; |
| 484 } | 484 } |
| 485 | 485 |
| 486 void ExtensionHost::SetRenderViewType(ViewType::Type type) { | 486 void ExtensionHost::SetRenderViewType(ViewType::Type type) { |
| 487 DCHECK(type == ViewType::EXTENSION_MOLE || | 487 DCHECK(type == ViewType::EXTENSION_MOLE || |
| 488 type == ViewType::EXTENSION_TOOLSTRIP); | 488 type == ViewType::EXTENSION_TOOLSTRIP || |
| 489 type == ViewType::EXTENSION_POPUP); |
| 489 extension_host_type_ = type; | 490 extension_host_type_ = type; |
| 490 render_view_host()->ViewTypeChanged(extension_host_type_); | 491 render_view_host()->ViewTypeChanged(extension_host_type_); |
| 491 } | 492 } |
| 492 | 493 |
| 493 ViewType::Type ExtensionHost::GetRenderViewType() const { | 494 ViewType::Type ExtensionHost::GetRenderViewType() const { |
| 494 return extension_host_type_; | 495 return extension_host_type_; |
| 495 } | 496 } |
| 496 | 497 |
| 497 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { | 498 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { |
| 498 if (view_.get()) | 499 if (view_.get()) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 519 window_id = ExtensionTabUtil::GetWindowId( | 520 window_id = ExtensionTabUtil::GetWindowId( |
| 520 const_cast<ExtensionHost* >(this)->GetBrowser()); | 521 const_cast<ExtensionHost* >(this)->GetBrowser()); |
| 521 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 522 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 522 // Background page is not attached to any browser window, so pass -1. | 523 // Background page is not attached to any browser window, so pass -1. |
| 523 window_id = -1; | 524 window_id = -1; |
| 524 } else { | 525 } else { |
| 525 NOTREACHED(); | 526 NOTREACHED(); |
| 526 } | 527 } |
| 527 return window_id; | 528 return window_id; |
| 528 } | 529 } |
| OLD | NEW |