| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 // On X11, setting fullscreen mode is an async call to the X server, which | 1578 // On X11, setting fullscreen mode is an async call to the X server, which |
| 1579 // may or may not support fullscreen mode. | 1579 // may or may not support fullscreen mode. |
| 1580 #if !defined(USE_X11) | 1580 #if !defined(USE_X11) |
| 1581 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); | 1581 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); |
| 1582 #endif | 1582 #endif |
| 1583 } | 1583 } |
| 1584 | 1584 |
| 1585 #if defined(OS_CHROMEOS) | 1585 #if defined(OS_CHROMEOS) |
| 1586 void Browser::Search() { | 1586 void Browser::Search() { |
| 1587 // If the NTP is showing, close it. | 1587 // If the NTP is showing, close it. |
| 1588 if (StartsWithASCII(GetSelectedTabContents()->GetURL().spec(), | 1588 const GURL& url = GetSelectedTabContents()->GetURL(); |
| 1589 chrome::kChromeUINewTabURL, true)) { | 1589 if (url.SchemeIs(chrome::kChromeUIScheme) && |
| 1590 LowerCaseEqualsASCII(url.host(), chrome::kChromeUINewTabHost)) { |
| 1590 CloseTab(); | 1591 CloseTab(); |
| 1591 return; | 1592 return; |
| 1592 } | 1593 } |
| 1593 | 1594 |
| 1594 // Exit fullscreen to show omnibox. | 1595 // Exit fullscreen to show omnibox. |
| 1595 if (window_->IsFullscreen()) { | 1596 if (window_->IsFullscreen()) { |
| 1596 ToggleFullscreenMode(); | 1597 ToggleFullscreenMode(); |
| 1597 // ToggleFullscreenMode is asynchronous, so we don't have omnibox | 1598 // ToggleFullscreenMode is asynchronous, so we don't have omnibox |
| 1598 // visible at this point. Wait for next event cycle which toggles | 1599 // visible at this point. Wait for next event cycle which toggles |
| 1599 // the visibility of omnibox before creating new tab. | 1600 // the visibility of omnibox before creating new tab. |
| (...skipping 3019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4619 TabContents* current_tab = GetSelectedTabContents(); | 4620 TabContents* current_tab = GetSelectedTabContents(); |
| 4620 if (current_tab) { | 4621 if (current_tab) { |
| 4621 content_restrictions = current_tab->content_restrictions(); | 4622 content_restrictions = current_tab->content_restrictions(); |
| 4622 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4623 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
| 4623 // See comment in UpdateCommandsForTabState about why we call url(). | 4624 // See comment in UpdateCommandsForTabState about why we call url(). |
| 4624 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4625 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
| 4625 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4626 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
| 4626 } | 4627 } |
| 4627 return content_restrictions; | 4628 return content_restrictions; |
| 4628 } | 4629 } |
| OLD | NEW |