| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_view_host.h" | 5 #include "chrome/browser/extensions/extension_view_host.h" |
| 6 | 6 |
| 7 #include "base/strings/string_piece.h" | 7 #include "base/strings/string_piece.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/extension_view.h" | 9 #include "chrome/browser/extensions/extension_view.h" |
| 10 #include "chrome/browser/extensions/window_controller.h" | 10 #include "chrome/browser/extensions/window_controller.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // Notifies an ExtensionViewHost when a WebContents is destroyed. | 36 // Notifies an ExtensionViewHost when a WebContents is destroyed. |
| 37 class ExtensionViewHost::AssociatedWebContentsObserver | 37 class ExtensionViewHost::AssociatedWebContentsObserver |
| 38 : public WebContentsObserver { | 38 : public WebContentsObserver { |
| 39 public: | 39 public: |
| 40 AssociatedWebContentsObserver(ExtensionViewHost* host, | 40 AssociatedWebContentsObserver(ExtensionViewHost* host, |
| 41 WebContents* web_contents) | 41 WebContents* web_contents) |
| 42 : WebContentsObserver(web_contents), host_(host) {} | 42 : WebContentsObserver(web_contents), host_(host) {} |
| 43 virtual ~AssociatedWebContentsObserver() {} | 43 virtual ~AssociatedWebContentsObserver() {} |
| 44 | 44 |
| 45 // content::WebContentsObserver: | 45 // content::WebContentsObserver: |
| 46 virtual void WebContentsDestroyed() OVERRIDE { | 46 virtual void WebContentsDestroyed() override { |
| 47 // Deleting |this| from here is safe. | 47 // Deleting |this| from here is safe. |
| 48 host_->SetAssociatedWebContents(NULL); | 48 host_->SetAssociatedWebContents(NULL); |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 ExtensionViewHost* host_; | 52 ExtensionViewHost* host_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(AssociatedWebContentsObserver); | 54 DISALLOW_COPY_AND_ASSIGN(AssociatedWebContentsObserver); |
| 55 }; | 55 }; |
| 56 | 56 |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 void ExtensionViewHost::InsertInfobarCSS() { | 317 void ExtensionViewHost::InsertInfobarCSS() { |
| 318 static const base::StringPiece css( | 318 static const base::StringPiece css( |
| 319 ResourceBundle::GetSharedInstance().GetRawDataResource( | 319 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 320 IDR_EXTENSIONS_INFOBAR_CSS)); | 320 IDR_EXTENSIONS_INFOBAR_CSS)); |
| 321 | 321 |
| 322 host_contents()->InsertCSS(css.as_string()); | 322 host_contents()->InsertCSS(css.as_string()); |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace extensions | 325 } // namespace extensions |
| OLD | NEW |