| 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 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
| 24 #include "chrome/common/pref_service.h" | 24 #include "chrome/common/pref_service.h" |
| 25 #include "chrome/common/view_types.h" | 25 #include "chrome/common/view_types.h" |
| 26 #include "chrome/common/render_messages.h" | 26 #include "chrome/common/render_messages.h" |
| 27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 28 | 28 |
| 29 #include "grit/browser_resources.h" | 29 #include "grit/browser_resources.h" |
| 30 | 30 |
| 31 #include "webkit/glue/context_menu.h" | 31 #include "webkit/glue/context_menu.h" |
| 32 | 32 |
| 33 using WebKit::WebDragOperation; |
| 34 using WebKit::WebDragOperationsMask; |
| 35 |
| 33 // static | 36 // static |
| 34 bool ExtensionHost::enable_dom_automation_ = false; | 37 bool ExtensionHost::enable_dom_automation_ = false; |
| 35 | 38 |
| 36 ExtensionHost::ExtensionHost(Extension* extension, SiteInstance* site_instance, | 39 ExtensionHost::ExtensionHost(Extension* extension, SiteInstance* site_instance, |
| 37 const GURL& url, ViewType::Type host_type) | 40 const GURL& url, ViewType::Type host_type) |
| 38 : extension_(extension), | 41 : extension_(extension), |
| 39 profile_(site_instance->browsing_instance()->profile()), | 42 profile_(site_instance->browsing_instance()->profile()), |
| 40 did_stop_loading_(false), | 43 did_stop_loading_(false), |
| 41 document_element_available_(false), | 44 document_element_available_(false), |
| 42 url_(url), | 45 url_(url), |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // TODO(erikkay): These two lines could be refactored with TabContentsView. | 271 // TODO(erikkay): These two lines could be refactored with TabContentsView. |
| 269 widget_host_view->InitAsPopup(render_view_host()->view(), initial_pos); | 272 widget_host_view->InitAsPopup(render_view_host()->view(), initial_pos); |
| 270 widget_host_view->GetRenderWidgetHost()->Init(); | 273 widget_host_view->GetRenderWidgetHost()->Init(); |
| 271 } | 274 } |
| 272 | 275 |
| 273 void ExtensionHost::ShowContextMenu(const ContextMenuParams& params) { | 276 void ExtensionHost::ShowContextMenu(const ContextMenuParams& params) { |
| 274 // TODO(erikkay) - This is a temporary hack. Show a menu here instead. | 277 // TODO(erikkay) - This is a temporary hack. Show a menu here instead. |
| 275 DevToolsManager::GetInstance()->OpenDevToolsWindow(render_view_host()); | 278 DevToolsManager::GetInstance()->OpenDevToolsWindow(render_view_host()); |
| 276 } | 279 } |
| 277 | 280 |
| 278 void ExtensionHost::StartDragging(const WebDropData& drop_data) { | 281 void ExtensionHost::StartDragging(const WebDropData& drop_data, |
| 282 WebDragOperationsMask operation_mask) { |
| 279 } | 283 } |
| 280 | 284 |
| 281 void ExtensionHost::UpdateDragCursor(bool is_drop_target) { | 285 void ExtensionHost::UpdateDragCursor(WebDragOperation operation) { |
| 282 } | 286 } |
| 283 | 287 |
| 284 void ExtensionHost::GotFocus() { | 288 void ExtensionHost::GotFocus() { |
| 285 } | 289 } |
| 286 | 290 |
| 287 void ExtensionHost::TakeFocus(bool reverse) { | 291 void ExtensionHost::TakeFocus(bool reverse) { |
| 288 } | 292 } |
| 289 | 293 |
| 290 void ExtensionHost::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 294 void ExtensionHost::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 291 } | 295 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 window_id = ExtensionTabUtil::GetWindowId( | 353 window_id = ExtensionTabUtil::GetWindowId( |
| 350 const_cast<ExtensionHost* >(this)->GetBrowser()); | 354 const_cast<ExtensionHost* >(this)->GetBrowser()); |
| 351 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { | 355 } else if (extension_host_type_ == ViewType::EXTENSION_BACKGROUND_PAGE) { |
| 352 // 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. |
| 353 window_id = -1; | 357 window_id = -1; |
| 354 } else { | 358 } else { |
| 355 NOTREACHED(); | 359 NOTREACHED(); |
| 356 } | 360 } |
| 357 return window_id; | 361 return window_id; |
| 358 } | 362 } |
| OLD | NEW |