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/window_controller.h" | 9 #include "chrome/browser/extensions/window_controller.h" |
10 #include "chrome/browser/file_select_helper.h" | 10 #include "chrome/browser/file_select_helper.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // Notifies an ExtensionViewHost when a WebContents is destroyed. | 35 // Notifies an ExtensionViewHost when a WebContents is destroyed. |
36 class ExtensionViewHost::AssociatedWebContentsObserver | 36 class ExtensionViewHost::AssociatedWebContentsObserver |
37 : public WebContentsObserver { | 37 : public WebContentsObserver { |
38 public: | 38 public: |
39 AssociatedWebContentsObserver(ExtensionViewHost* host, | 39 AssociatedWebContentsObserver(ExtensionViewHost* host, |
40 WebContents* web_contents) | 40 WebContents* web_contents) |
41 : WebContentsObserver(web_contents), host_(host) {} | 41 : WebContentsObserver(web_contents), host_(host) {} |
42 virtual ~AssociatedWebContentsObserver() {} | 42 virtual ~AssociatedWebContentsObserver() {} |
43 | 43 |
44 // content::WebContentsObserver: | 44 // content::WebContentsObserver: |
45 virtual void WebContentsDestroyed(WebContents* web_contents) OVERRIDE { | 45 virtual void WebContentsDestroyed() OVERRIDE { |
46 // Deleting |this| from here is safe. | 46 // Deleting |this| from here is safe. |
47 host_->SetAssociatedWebContents(NULL); | 47 host_->SetAssociatedWebContents(NULL); |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 ExtensionViewHost* host_; | 51 ExtensionViewHost* host_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(AssociatedWebContentsObserver); | 53 DISALLOW_COPY_AND_ASSIGN(AssociatedWebContentsObserver); |
54 }; | 54 }; |
55 | 55 |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 | 336 |
337 void ExtensionViewHost::InsertInfobarCSS() { | 337 void ExtensionViewHost::InsertInfobarCSS() { |
338 static const base::StringPiece css( | 338 static const base::StringPiece css( |
339 ResourceBundle::GetSharedInstance().GetRawDataResource( | 339 ResourceBundle::GetSharedInstance().GetRawDataResource( |
340 IDR_EXTENSIONS_INFOBAR_CSS)); | 340 IDR_EXTENSIONS_INFOBAR_CSS)); |
341 | 341 |
342 host_contents()->InsertCSS(css.as_string()); | 342 host_contents()->InsertCSS(css.as_string()); |
343 } | 343 } |
344 | 344 |
345 } // namespace extensions | 345 } // namespace extensions |
OLD | NEW |