| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 url_ = params.url; | 144 url_ = params.url; |
| 145 if (!url_.SchemeIs(chrome::kExtensionScheme)) { | 145 if (!url_.SchemeIs(chrome::kExtensionScheme)) { |
| 146 extension_function_dispatcher_.reset(NULL); | 146 extension_function_dispatcher_.reset(NULL); |
| 147 return; | 147 return; |
| 148 } | 148 } |
| 149 extension_function_dispatcher_.reset( | 149 extension_function_dispatcher_.reset( |
| 150 new ExtensionFunctionDispatcher(render_view_host_, this, url_)); | 150 new ExtensionFunctionDispatcher(render_view_host_, this, url_)); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void ExtensionHost::DidStopLoading(RenderViewHost* render_view_host) { | 153 void ExtensionHost::DidStopLoading(RenderViewHost* render_view_host) { |
| 154 static const StringPiece toolstrip_css( | 154 static const base::StringPiece toolstrip_css( |
| 155 ResourceBundle::GetSharedInstance().GetRawDataResource( | 155 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 156 IDR_EXTENSIONS_TOOLSTRIP_CSS)); | 156 IDR_EXTENSIONS_TOOLSTRIP_CSS)); |
| 157 #if defined(TOOLKIT_VIEWS) | 157 #if defined(TOOLKIT_VIEWS) |
| 158 ExtensionView* view = view_.get(); | 158 ExtensionView* view = view_.get(); |
| 159 if (view) { | 159 if (view) { |
| 160 // TODO(erikkay) this injection should really happen in the renderer. | 160 // TODO(erikkay) this injection should really happen in the renderer. |
| 161 // When the Jerry's view type change lands, investigate moving this there. | 161 // When the Jerry's view type change lands, investigate moving this there. |
| 162 | 162 |
| 163 // As a toolstrip, inject our toolstrip CSS to make it easier for toolstrips | 163 // As a toolstrip, inject our toolstrip CSS to make it easier for toolstrips |
| 164 // to blend in with the chrome UI. | 164 // to blend in with the chrome UI. |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 window_id = ExtensionTabUtil::GetWindowId( | 353 window_id = ExtensionTabUtil::GetWindowId( |
| 354 const_cast<ExtensionHost* >(this)->GetBrowser()); | 354 const_cast<ExtensionHost* >(this)->GetBrowser()); |
| 355 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 355 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 356 // Background page is not attached to any browser window, so pass -1. | 356 // Background page is not attached to any browser window, so pass -1. |
| 357 window_id = -1; | 357 window_id = -1; |
| 358 } else { | 358 } else { |
| 359 NOTREACHED(); | 359 NOTREACHED(); |
| 360 } | 360 } |
| 361 return window_id; | 361 return window_id; |
| 362 } | 362 } |
| OLD | NEW |