| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/public/browser/render_process_host.h" | 42 #include "content/public/browser/render_process_host.h" |
| 43 #include "content/public/browser/render_view_host.h" | 43 #include "content/public/browser/render_view_host.h" |
| 44 #include "content/public/browser/site_instance.h" | 44 #include "content/public/browser/site_instance.h" |
| 45 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
| 46 #include "content/public/browser/web_contents_view.h" | 46 #include "content/public/browser/web_contents_view.h" |
| 47 #include "grit/browser_resources.h" | 47 #include "grit/browser_resources.h" |
| 48 #include "grit/chromium_strings.h" | 48 #include "grit/chromium_strings.h" |
| 49 #include "grit/generated_resources.h" | 49 #include "grit/generated_resources.h" |
| 50 #include "ui/base/keycodes/keyboard_codes.h" | 50 #include "ui/base/keycodes/keyboard_codes.h" |
| 51 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
| 52 #include "ui/base/layout.h" |
| 52 #include "ui/base/resource/resource_bundle.h" | 53 #include "ui/base/resource/resource_bundle.h" |
| 53 | 54 |
| 54 #if defined(TOOLKIT_VIEWS) | 55 #if defined(TOOLKIT_VIEWS) |
| 55 #include "ui/views/widget/widget.h" | 56 #include "ui/views/widget/widget.h" |
| 56 #endif | 57 #endif |
| 57 | 58 |
| 58 using WebKit::WebDragOperation; | 59 using WebKit::WebDragOperation; |
| 59 using WebKit::WebDragOperationsMask; | 60 using WebKit::WebDragOperationsMask; |
| 60 using content::OpenURLParams; | 61 using content::OpenURLParams; |
| 61 using content::RenderViewHost; | 62 using content::RenderViewHost; |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 321 chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
| 321 content::Source<Profile>(profile_), | 322 content::Source<Profile>(profile_), |
| 322 content::Details<ExtensionHost>(this)); | 323 content::Details<ExtensionHost>(this)); |
| 323 } | 324 } |
| 324 | 325 |
| 325 void ExtensionHost::InsertInfobarCSS() { | 326 void ExtensionHost::InsertInfobarCSS() { |
| 326 DCHECK(!is_background_page()); | 327 DCHECK(!is_background_page()); |
| 327 | 328 |
| 328 static const base::StringPiece css( | 329 static const base::StringPiece css( |
| 329 ResourceBundle::GetSharedInstance().GetRawDataResource( | 330 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 330 IDR_EXTENSIONS_INFOBAR_CSS)); | 331 IDR_EXTENSIONS_INFOBAR_CSS, ui::SCALE_FACTOR_NONE)); |
| 331 | 332 |
| 332 render_view_host()->InsertCSS(string16(), css.as_string()); | 333 render_view_host()->InsertCSS(string16(), css.as_string()); |
| 333 } | 334 } |
| 334 | 335 |
| 335 void ExtensionHost::DidStopLoading() { | 336 void ExtensionHost::DidStopLoading() { |
| 336 bool notify = !did_stop_loading_; | 337 bool notify = !did_stop_loading_; |
| 337 did_stop_loading_ = true; | 338 did_stop_loading_ = true; |
| 338 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || | 339 if (extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_POPUP || |
| 339 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || | 340 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_DIALOG || |
| 340 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || | 341 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 params.user_gesture = user_gesture; | 587 params.user_gesture = user_gesture; |
| 587 browser::Navigate(¶ms); | 588 browser::Navigate(¶ms); |
| 588 } | 589 } |
| 589 | 590 |
| 590 void ExtensionHost::RenderViewReady() { | 591 void ExtensionHost::RenderViewReady() { |
| 591 content::NotificationService::current()->Notify( | 592 content::NotificationService::current()->Notify( |
| 592 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, | 593 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, |
| 593 content::Source<Profile>(profile_), | 594 content::Source<Profile>(profile_), |
| 594 content::Details<ExtensionHost>(this)); | 595 content::Details<ExtensionHost>(this)); |
| 595 } | 596 } |
| OLD | NEW |