OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/constrained_window_tab_helper.h" | 5 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
6 | 6 |
7 #include "chrome/browser/ui/constrained_window.h" | 7 #include "chrome/browser/ui/constrained_window.h" |
8 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" | 8 #include "chrome/browser/ui/constrained_window_tab_helper_delegate.h" |
9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper_delegate.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 rwhv->SetVisuallyDeemphasized(blocked ? &greyish : NULL, false); | 80 rwhv->SetVisuallyDeemphasized(blocked ? &greyish : NULL, false); |
81 // RenderViewHost may be NULL during shutdown. | 81 // RenderViewHost may be NULL during shutdown. |
82 if (contents->render_view_host()) | 82 if (contents->render_view_host()) |
83 contents->render_view_host()->set_ignore_input_events(blocked); | 83 contents->render_view_host()->set_ignore_input_events(blocked); |
84 if (delegate_) | 84 if (delegate_) |
85 delegate_->SetTabContentBlocked(wrapper_, blocked); | 85 delegate_->SetTabContentBlocked(wrapper_, blocked); |
86 } | 86 } |
87 | 87 |
88 void ConstrainedWindowTabHelper::DidNavigateMainFrame( | 88 void ConstrainedWindowTabHelper::DidNavigateMainFrame( |
89 const content::LoadCommittedDetails& details, | 89 const content::LoadCommittedDetails& details, |
90 const ViewHostMsg_FrameNavigate_Params& params) { | 90 const content::FrameNavigateParams& params) { |
91 // Close constrained windows if necessary. | 91 // Close constrained windows if necessary. |
92 if (!net::RegistryControlledDomainService::SameDomainOrHost( | 92 if (!net::RegistryControlledDomainService::SameDomainOrHost( |
93 details.previous_url, details.entry->url())) | 93 details.previous_url, details.entry->url())) |
94 CloseConstrainedWindows(); | 94 CloseConstrainedWindows(); |
95 } | 95 } |
96 | 96 |
97 void ConstrainedWindowTabHelper::DidGetIgnoredUIEvent() { | 97 void ConstrainedWindowTabHelper::DidGetIgnoredUIEvent() { |
98 if (constrained_window_count()) { | 98 if (constrained_window_count()) { |
99 ConstrainedWindow* window = *constrained_window_begin(); | 99 ConstrainedWindow* window = *constrained_window_begin(); |
100 window->FocusConstrainedWindow(); | 100 window->FocusConstrainedWindow(); |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 void ConstrainedWindowTabHelper::TabContentsDestroyed(TabContents* tab) { | 104 void ConstrainedWindowTabHelper::TabContentsDestroyed(TabContents* tab) { |
105 // First cleanly close all child windows. | 105 // First cleanly close all child windows. |
106 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked | 106 // TODO(mpcomplete): handle case if MaybeCloseChildWindows() already asked |
107 // some of these to close. CloseWindows is async, so it might get called | 107 // some of these to close. CloseWindows is async, so it might get called |
108 // twice before it runs. | 108 // twice before it runs. |
109 CloseConstrainedWindows(); | 109 CloseConstrainedWindows(); |
110 } | 110 } |
OLD | NEW |