| 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/dom_ui/filebrowse_ui.h" | 5 #include "chrome/browser/dom_ui/filebrowse_ui.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 browser->window()->Show(); | 1068 browser->window()->Show(); |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 return browser; | 1071 return browser; |
| 1072 } | 1072 } |
| 1073 | 1073 |
| 1074 Browser* FileBrowseUI::GetPopupForPath(const std::string& path) { | 1074 Browser* FileBrowseUI::GetPopupForPath(const std::string& path) { |
| 1075 for (BrowserList::const_iterator it = BrowserList::begin(); | 1075 for (BrowserList::const_iterator it = BrowserList::begin(); |
| 1076 it != BrowserList::end(); ++it) { | 1076 it != BrowserList::end(); ++it) { |
| 1077 if ((*it)->type() == Browser::TYPE_POPUP) { | 1077 if ((*it)->type() == Browser::TYPE_POPUP) { |
| 1078 const GURL& url = | 1078 TabContents* tab_contents = (*it)->GetSelectedTabContents(); |
| 1079 (*it)->GetTabContentsAt((*it)->selected_index())->GetURL(); | 1079 DCHECK(tab_contents); |
| 1080 if (!tab_contents) |
| 1081 continue; |
| 1082 const GURL& url = tab_contents->GetURL(); |
| 1080 | 1083 |
| 1081 if (url.SchemeIs(chrome::kChromeUIScheme) && | 1084 if (url.SchemeIs(chrome::kChromeUIScheme) && |
| 1082 url.host() == chrome::kChromeUIFileBrowseHost && | 1085 url.host() == chrome::kChromeUIFileBrowseHost && |
| 1083 url.ref() == path) { | 1086 url.ref() == path) { |
| 1084 return (*it); | 1087 return (*it); |
| 1085 } | 1088 } |
| 1086 } | 1089 } |
| 1087 } | 1090 } |
| 1088 | 1091 |
| 1089 return NULL; | 1092 return NULL; |
| 1090 } | 1093 } |
| 1091 | 1094 |
| 1092 const int FileBrowseUI::kPopupWidth = 250; | 1095 const int FileBrowseUI::kPopupWidth = 250; |
| 1093 const int FileBrowseUI::kPopupHeight = 300; | 1096 const int FileBrowseUI::kPopupHeight = 300; |
| 1094 const int FileBrowseUI::kSmallPopupWidth = 250; | 1097 const int FileBrowseUI::kSmallPopupWidth = 250; |
| 1095 const int FileBrowseUI::kSmallPopupHeight = 50; | 1098 const int FileBrowseUI::kSmallPopupHeight = 50; |
| OLD | NEW |