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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 void ExtensionViewHost::CreateView(Browser* browser) { | 79 void ExtensionViewHost::CreateView(Browser* browser) { |
80 #if defined(TOOLKIT_VIEWS) | 80 #if defined(TOOLKIT_VIEWS) |
81 view_.reset(new ExtensionViewViews(this, browser)); | 81 view_.reset(new ExtensionViewViews(this, browser)); |
82 // We own |view_|, so don't auto delete when it's removed from the view | 82 // We own |view_|, so don't auto delete when it's removed from the view |
83 // hierarchy. | 83 // hierarchy. |
84 view_->set_owned_by_client(); | 84 view_->set_owned_by_client(); |
85 #elif defined(OS_MACOSX) | 85 #elif defined(OS_MACOSX) |
86 view_.reset(new ExtensionViewMac(this, browser)); | 86 view_.reset(new ExtensionViewMac(this, browser)); |
87 view_->Init(); | 87 view_->Init(); |
88 #elif defined(TOOLKIT_GTK) | |
89 view_.reset(new ExtensionViewGtk(this, browser)); | |
90 view_->Init(); | |
91 #else | 88 #else |
92 // TODO(port) | 89 // TODO(port) |
93 NOTREACHED(); | 90 NOTREACHED(); |
94 #endif | 91 #endif |
95 } | 92 } |
96 | 93 |
97 void ExtensionViewHost::SetAssociatedWebContents(WebContents* web_contents) { | 94 void ExtensionViewHost::SetAssociatedWebContents(WebContents* web_contents) { |
98 associated_web_contents_ = web_contents; | 95 associated_web_contents_ = web_contents; |
99 if (associated_web_contents_) { | 96 if (associated_web_contents_) { |
100 // Observe the new WebContents for deletion. | 97 // Observe the new WebContents for deletion. |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 337 |
341 void ExtensionViewHost::InsertInfobarCSS() { | 338 void ExtensionViewHost::InsertInfobarCSS() { |
342 static const base::StringPiece css( | 339 static const base::StringPiece css( |
343 ResourceBundle::GetSharedInstance().GetRawDataResource( | 340 ResourceBundle::GetSharedInstance().GetRawDataResource( |
344 IDR_EXTENSIONS_INFOBAR_CSS)); | 341 IDR_EXTENSIONS_INFOBAR_CSS)); |
345 | 342 |
346 host_contents()->InsertCSS(css.as_string()); | 343 host_contents()->InsertCSS(css.as_string()); |
347 } | 344 } |
348 | 345 |
349 } // namespace extensions | 346 } // namespace extensions |
OLD | NEW |