Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: chrome/browser/external_tab_container.cc

Issue 115833: With the recent change to the ExternalTabContainer to have it subclass Widget... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/chrome_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/external_tab_container.h" 5 #include "chrome/browser/external_tab_container.h"
6 6
7 #include "app/win_util.h" 7 #include "app/win_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/win_util.h" 9 #include "base/win_util.h"
10 #include "chrome/browser/automation/automation_provider.h" 10 #include "chrome/browser/automation/automation_provider.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 void ExternalTabContainer::SetInitialFocus(bool reverse) { 117 void ExternalTabContainer::SetInitialFocus(bool reverse) {
118 DCHECK(tab_contents_); 118 DCHECK(tab_contents_);
119 if (tab_contents_) { 119 if (tab_contents_) {
120 static_cast<TabContents*>(tab_contents_)->Focus(); 120 static_cast<TabContents*>(tab_contents_)->Focus();
121 static_cast<TabContents*>(tab_contents_)->SetInitialFocus(reverse); 121 static_cast<TabContents*>(tab_contents_)->SetInitialFocus(reverse);
122 } 122 }
123 } 123 }
124 124
125 // static 125 // static
126 bool ExternalTabContainer::IsExternalTabContainer(HWND window) { 126 bool ExternalTabContainer::IsExternalTabContainer(HWND window) {
127 std::wstring class_name = win_util::GetClassName(window); 127 if (GetProp(window, kWindowObjectKey) != NULL)
128 return _wcsicmp(class_name.c_str(), chrome::kExternalTabWindowClass) == 0; 128 return true;
129
130 return false;
129 } 131 }
130 132
131 // static 133 // static
132 ExternalTabContainer* ExternalTabContainer::GetContainerForTab( 134 ExternalTabContainer* ExternalTabContainer::GetContainerForTab(
133 HWND tab_window) { 135 HWND tab_window) {
134 HWND parent_window = ::GetParent(tab_window); 136 HWND parent_window = ::GetParent(tab_window);
135 if (!::IsWindow(parent_window)) { 137 if (!::IsWindow(parent_window)) {
136 return NULL; 138 return NULL;
137 } 139 }
138 if (!IsExternalTabContainer(parent_window)) { 140 if (!IsExternalTabContainer(parent_window)) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 NotificationService::current()->Notify( 385 NotificationService::current()->Notify(
384 NotificationType::EXTERNAL_TAB_CLOSED, 386 NotificationType::EXTERNAL_TAB_CLOSED,
385 Source<NavigationController>(&tab_contents_->controller()), 387 Source<NavigationController>(&tab_contents_->controller()),
386 Details<ExternalTabContainer>(this)); 388 Details<ExternalTabContainer>(this));
387 389
388 delete tab_contents_; 390 delete tab_contents_;
389 tab_contents_ = NULL; 391 tab_contents_ = NULL;
390 } 392 }
391 } 393 }
392 394
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698