| 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 "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" | 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 TabRendererData::NetworkState TabContentsNetworkState( | 53 TabRendererData::NetworkState TabContentsNetworkState( |
| 54 WebContents* contents) { | 54 WebContents* contents) { |
| 55 if (!contents || !contents->IsLoadingToDifferentDocument()) | 55 if (!contents || !contents->IsLoadingToDifferentDocument()) |
| 56 return TabRendererData::NETWORK_STATE_NONE; | 56 return TabRendererData::NETWORK_STATE_NONE; |
| 57 if (contents->IsWaitingForResponse()) | 57 if (contents->IsWaitingForResponse()) |
| 58 return TabRendererData::NETWORK_STATE_WAITING; | 58 return TabRendererData::NETWORK_STATE_WAITING; |
| 59 return TabRendererData::NETWORK_STATE_LOADING; | 59 return TabRendererData::NETWORK_STATE_LOADING; |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool DetermineTabStripLayoutStacked( | 62 bool DetermineTabStripLayoutStacked(PrefService* prefs, |
| 63 PrefService* prefs, | 63 ui::HostDesktopType host_desktop_type, |
| 64 chrome::HostDesktopType host_desktop_type, | 64 bool* adjust_layout) { |
| 65 bool* adjust_layout) { | |
| 66 *adjust_layout = false; | 65 *adjust_layout = false; |
| 67 // For ash, always allow entering stacked mode. | 66 // For ash, always allow entering stacked mode. |
| 68 if (host_desktop_type != chrome::HOST_DESKTOP_TYPE_ASH) | 67 if (host_desktop_type != ui::HOST_DESKTOP_TYPE_ASH) |
| 69 return false; | 68 return false; |
| 70 *adjust_layout = true; | 69 *adjust_layout = true; |
| 71 return prefs->GetBoolean(prefs::kTabStripStackedLayout); | 70 return prefs->GetBoolean(prefs::kTabStripStackedLayout); |
| 72 } | 71 } |
| 73 | 72 |
| 74 // Get the MIME type of the file pointed to by the url, based on the file's | 73 // Get the MIME type of the file pointed to by the url, based on the file's |
| 75 // extension. Must be called on a thread that allows IO. | 74 // extension. Must be called on a thread that allows IO. |
| 76 std::string FindURLMimeType(const GURL& url) { | 75 std::string FindURLMimeType(const GURL& url) { |
| 77 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 76 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 78 base::FilePath full_path; | 77 base::FilePath full_path; |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 content::WebPluginInfo plugin; | 576 content::WebPluginInfo plugin; |
| 578 tabstrip_->FileSupported( | 577 tabstrip_->FileSupported( |
| 579 url, | 578 url, |
| 580 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || | 579 mime_type.empty() || mime_util::IsSupportedMimeType(mime_type) || |
| 581 content::PluginService::GetInstance()->GetPluginInfo( | 580 content::PluginService::GetInstance()->GetPluginInfo( |
| 582 -1, // process ID | 581 -1, // process ID |
| 583 MSG_ROUTING_NONE, // routing ID | 582 MSG_ROUTING_NONE, // routing ID |
| 584 model_->profile()->GetResourceContext(), url, GURL(), mime_type, | 583 model_->profile()->GetResourceContext(), url, GURL(), mime_type, |
| 585 false, NULL, &plugin, NULL)); | 584 false, NULL, &plugin, NULL)); |
| 586 } | 585 } |
| OLD | NEW |