Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/tab_contents/tab_contents_container.h" | 5 #include "chrome/browser/views/tab_contents/tab_contents_container.h" |
| 6 | 6 |
| 7 #include "chrome/browser/tab_contents/interstitial_page.h" | 7 #include "chrome/browser/tab_contents/interstitial_page.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 9 #include "chrome/browser/view_ids.h" | 9 #include "chrome/browser/view_ids.h" |
| 10 #include "chrome/browser/views/tab_contents/native_tab_contents_container.h" | 10 #include "chrome/browser/views/tab_contents/native_tab_contents_container.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 //////////////////////////////////////////////////////////////////////////////// | 68 //////////////////////////////////////////////////////////////////////////////// |
| 69 // TabContentsContainer, View overrides: | 69 // TabContentsContainer, View overrides: |
| 70 | 70 |
| 71 void TabContentsContainer::Layout() { | 71 void TabContentsContainer::Layout() { |
| 72 if (native_container_) { | 72 if (native_container_) { |
| 73 native_container_->GetView()->SetBounds(0, 0, width(), height()); | 73 native_container_->GetView()->SetBounds(0, 0, width(), height()); |
| 74 native_container_->GetView()->Layout(); | 74 native_container_->GetView()->Layout(); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 bool TabContentsContainer::GetAccessibleRole(AccessibilityTypes::Role* role) { | |
| 79 DCHECK(role); | |
| 80 | |
| 81 *role = AccessibilityTypes::ROLE_WINDOW; | |
| 82 return true; | |
| 83 } | |
| 84 | |
| 85 bool TabContentsContainer::GetAccessibleName(std::wstring* name) { | |
| 86 if (!accessible_name_.empty()) { | |
|
jcampan
2009/07/14 16:44:24
Same nit as previously mentioned.
| |
| 87 (*name).assign(accessible_name_); | |
| 88 return true; | |
| 89 } | |
| 90 return false; | |
| 91 } | |
| 92 | |
| 93 void TabContentsContainer::SetAccessibleName(const std::wstring& name) { | |
| 94 accessible_name_.assign(name); | |
| 95 } | |
| 96 | |
| 78 void TabContentsContainer::ViewHierarchyChanged(bool is_add, | 97 void TabContentsContainer::ViewHierarchyChanged(bool is_add, |
| 79 views::View* parent, | 98 views::View* parent, |
| 80 views::View* child) { | 99 views::View* child) { |
| 81 if (is_add && child == this) { | 100 if (is_add && child == this) { |
| 82 native_container_ = NativeTabContentsContainer::CreateNativeContainer(this); | 101 native_container_ = NativeTabContentsContainer::CreateNativeContainer(this); |
| 83 AddChildView(native_container_->GetView()); | 102 AddChildView(native_container_->GetView()); |
| 84 } | 103 } |
| 85 } | 104 } |
| 86 | 105 |
| 87 //////////////////////////////////////////////////////////////////////////////// | 106 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 108 RenderViewHost* new_host) { | 127 RenderViewHost* new_host) { |
| 109 native_container_->RenderViewHostChanged(old_host, new_host); | 128 native_container_->RenderViewHostChanged(old_host, new_host); |
| 110 } | 129 } |
| 111 | 130 |
| 112 void TabContentsContainer::TabContentsDestroyed(TabContents* contents) { | 131 void TabContentsContainer::TabContentsDestroyed(TabContents* contents) { |
| 113 // Sometimes, a TabContents is destroyed before we know about it. This allows | 132 // Sometimes, a TabContents is destroyed before we know about it. This allows |
| 114 // us to clean up our state in case this happens. | 133 // us to clean up our state in case this happens. |
| 115 DCHECK(contents == tab_contents_); | 134 DCHECK(contents == tab_contents_); |
| 116 ChangeTabContents(NULL); | 135 ChangeTabContents(NULL); |
| 117 } | 136 } |
| OLD | NEW |