| 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/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return extension_host_type_; | 338 return extension_host_type_; |
| 339 } | 339 } |
| 340 | 340 |
| 341 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { | 341 void ExtensionHost::RenderViewCreated(RenderViewHost* render_view_host) { |
| 342 // TODO(mpcomplete): This is duplicated in DidNavigate, which means that | 342 // TODO(mpcomplete): This is duplicated in DidNavigate, which means that |
| 343 // we'll create 2 EFDs for the first navigation. We should try to find a | 343 // we'll create 2 EFDs for the first navigation. We should try to find a |
| 344 // better way to unify them. | 344 // better way to unify them. |
| 345 // See http://code.google.com/p/chromium/issues/detail?id=18240 | 345 // See http://code.google.com/p/chromium/issues/detail?id=18240 |
| 346 extension_function_dispatcher_.reset( | 346 extension_function_dispatcher_.reset( |
| 347 new ExtensionFunctionDispatcher(render_view_host, this, url_)); | 347 new ExtensionFunctionDispatcher(render_view_host, this, url_)); |
| 348 |
| 349 render_view_host->Send(new ViewMsg_EnableIntrinsicWidthChangedMode( |
| 350 render_view_host->routing_id())); |
| 348 } | 351 } |
| 349 | 352 |
| 350 int ExtensionHost::GetBrowserWindowID() const { | 353 int ExtensionHost::GetBrowserWindowID() const { |
| 351 int window_id = -1; | 354 int window_id = -1; |
| 352 if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP) { | 355 if (extension_host_type_ == ViewType::EXTENSION_TOOLSTRIP) { |
| 353 window_id = ExtensionTabUtil::GetWindowId( | 356 window_id = ExtensionTabUtil::GetWindowId( |
| 354 const_cast<ExtensionHost* >(this)->GetBrowser()); | 357 const_cast<ExtensionHost* >(this)->GetBrowser()); |
| 355 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 358 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 356 // Background page is not attached to any browser window, so pass -1. | 359 // Background page is not attached to any browser window, so pass -1. |
| 357 window_id = -1; | 360 window_id = -1; |
| 358 } else { | 361 } else { |
| 359 NOTREACHED(); | 362 NOTREACHED(); |
| 360 } | 363 } |
| 361 return window_id; | 364 return window_id; |
| 362 } | 365 } |
| OLD | NEW |