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 "content/browser/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 aura::Window* root_window = context ? context->GetRootWindow() : NULL; | 840 aura::Window* root_window = context ? context->GetRootWindow() : NULL; |
841 if (root_window) { | 841 if (root_window) { |
842 // There are places where there is no context currently because object | 842 // There are places where there is no context currently because object |
843 // hierarchies are built before they're attached to a Widget. (See | 843 // hierarchies are built before they're attached to a Widget. (See |
844 // views::WebView as an example; GetWidget() returns NULL at the point | 844 // views::WebView as an example; GetWidget() returns NULL at the point |
845 // where we are created.) | 845 // where we are created.) |
846 // | 846 // |
847 // It should be OK to not set a default parent since such users will | 847 // It should be OK to not set a default parent since such users will |
848 // explicitly add this WebContentsViewAura to their tree after they create | 848 // explicitly add this WebContentsViewAura to their tree after they create |
849 // us. | 849 // us. |
850 if (root_window) { | 850 aura::client::ParentWindowWithContext(window_.get(), root_window, |
851 aura::client::ParentWindowWithContext( | 851 root_window->GetBoundsInScreen()); |
852 window_.get(), root_window, root_window->GetBoundsInScreen()); | |
853 } | |
854 } | 852 } |
855 window_->layer()->SetMasksToBounds(true); | 853 window_->layer()->SetMasksToBounds(true); |
856 window_->SetName("WebContentsViewAura"); | 854 window_->SetName("WebContentsViewAura"); |
857 | 855 |
858 // WindowObserver is not interesting and is problematic for Browser Plugin | 856 // WindowObserver is not interesting and is problematic for Browser Plugin |
859 // guests. | 857 // guests. |
860 // The use cases for WindowObserver do not apply to Browser Plugins: | 858 // The use cases for WindowObserver do not apply to Browser Plugins: |
861 // 1) guests do not support NPAPI plugins. | 859 // 1) guests do not support NPAPI plugins. |
862 // 2) guests' window bounds are supposed to come from its embedder. | 860 // 2) guests' window bounds are supposed to come from its embedder. |
863 if (!BrowserPluginGuest::IsGuest(web_contents_)) | 861 if (!BrowserPluginGuest::IsGuest(web_contents_)) |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 if (visible) { | 1316 if (visible) { |
1319 if (!web_contents_->should_normally_be_visible()) | 1317 if (!web_contents_->should_normally_be_visible()) |
1320 web_contents_->WasShown(); | 1318 web_contents_->WasShown(); |
1321 } else { | 1319 } else { |
1322 if (web_contents_->should_normally_be_visible()) | 1320 if (web_contents_->should_normally_be_visible()) |
1323 web_contents_->WasHidden(); | 1321 web_contents_->WasHidden(); |
1324 } | 1322 } |
1325 } | 1323 } |
1326 | 1324 |
1327 } // namespace content | 1325 } // namespace content |
OLD | NEW |