Chromium Code Reviews| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/task_runner_util.h" | 10 #include "base/task_runner_util.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 TabStripLayoutType DetermineTabStripLayout( | 62 TabStripLayoutType DetermineTabStripLayout( |
| 63 PrefService* prefs, | 63 PrefService* prefs, |
| 64 chrome::HostDesktopType host_desktop_type, | 64 chrome::HostDesktopType host_desktop_type, |
| 65 bool* adjust_layout) { | 65 bool* adjust_layout) { |
| 66 *adjust_layout = false; | 66 *adjust_layout = false; |
| 67 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 68 switches::kEnableStackedTabStrip)) { | |
| 69 return TAB_STRIP_LAYOUT_STACKED; | |
| 70 } | |
| 71 // For ash, always allow entering stacked mode. | 67 // For ash, always allow entering stacked mode. |
| 72 if (host_desktop_type != chrome::HOST_DESKTOP_TYPE_ASH) | 68 if (host_desktop_type != chrome::HOST_DESKTOP_TYPE_ASH) |
| 73 return TAB_STRIP_LAYOUT_SHRINK; | 69 return TAB_STRIP_LAYOUT_SHRINK; |
| 74 *adjust_layout = true; | 70 *adjust_layout = true; |
| 75 switch (prefs->GetInteger(prefs::kTabStripLayoutType)) { | 71 switch (prefs->GetInteger(prefs::kTabStripLayoutType)) { |
| 76 case TAB_STRIP_LAYOUT_STACKED: | 72 case TAB_STRIP_LAYOUT_STACKED: |
| 77 return TAB_STRIP_LAYOUT_STACKED; | 73 return TAB_STRIP_LAYOUT_STACKED; |
| 78 default: | 74 default: |
| 79 return TAB_STRIP_LAYOUT_SHRINK; | 75 return TAB_STRIP_LAYOUT_SHRINK; |
|
Peter Kasting
2014/05/20 20:48:15
While you're touching this code, it looks like the
varkha
2014/05/21 15:03:25
+sky@, should I maybe refactor this to boolean sta
sky
2014/05/21 16:30:08
Agreed.
| |
| 80 } | 76 } |
| 81 } | 77 } |
| 82 | 78 |
| 83 // Get the MIME type of the file pointed to by the url, based on the file's | 79 // Get the MIME type of the file pointed to by the url, based on the file's |
| 84 // extension. Must be called on a thread that allows IO. | 80 // extension. Must be called on a thread that allows IO. |
| 85 std::string FindURLMimeType(const GURL& url) { | 81 std::string FindURLMimeType(const GURL& url) { |
| 86 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 82 DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 87 base::FilePath full_path; | 83 base::FilePath full_path; |
| 88 net::FileURLToFilePath(url, &full_path); | 84 net::FileURLToFilePath(url, &full_path); |
| 89 | 85 |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 url, | 584 url, |
| 589 mime_type.empty() || | 585 mime_type.empty() || |
| 590 net::IsSupportedMimeType(mime_type) || | 586 net::IsSupportedMimeType(mime_type) || |
| 591 content::PluginService::GetInstance()->GetPluginInfo( | 587 content::PluginService::GetInstance()->GetPluginInfo( |
| 592 -1, // process ID | 588 -1, // process ID |
| 593 MSG_ROUTING_NONE, // routing ID | 589 MSG_ROUTING_NONE, // routing ID |
| 594 model_->profile()->GetResourceContext(), | 590 model_->profile()->GetResourceContext(), |
| 595 url, GURL(), mime_type, false, | 591 url, GURL(), mime_type, false, |
| 596 NULL, &plugin, NULL)); | 592 NULL, &plugin, NULL)); |
| 597 } | 593 } |
| OLD | NEW |