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

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

Issue 7049004: Normalize chrome://foo/ trailing slashes, ChromeURLHostEquals comparison, RIP dead consts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move ChromeURLHostEquals to web_ui_util. Created 9 years, 7 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 | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/ui/gtk/browser_toolbar_gtk.cc » ('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) 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 #include "chrome/browser/ui/panels/panel_manager.h" 88 #include "chrome/browser/ui/panels/panel_manager.h"
89 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 89 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
90 #include "chrome/browser/ui/status_bubble.h" 90 #include "chrome/browser/ui/status_bubble.h"
91 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 91 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
92 #include "chrome/browser/ui/tabs/dock_info.h" 92 #include "chrome/browser/ui/tabs/dock_info.h"
93 #include "chrome/browser/ui/tabs/tab_menu_model.h" 93 #include "chrome/browser/ui/tabs/tab_menu_model.h"
94 #include "chrome/browser/ui/web_applications/web_app_ui.h" 94 #include "chrome/browser/ui/web_applications/web_app_ui.h"
95 #include "chrome/browser/ui/webui/active_downloads_ui.h" 95 #include "chrome/browser/ui/webui/active_downloads_ui.h"
96 #include "chrome/browser/ui/webui/bug_report_ui.h" 96 #include "chrome/browser/ui/webui/bug_report_ui.h"
97 #include "chrome/browser/ui/webui/options/content_settings_handler.h" 97 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
98 #include "chrome/browser/ui/webui/web_ui_util.h"
98 #include "chrome/browser/ui/window_sizer.h" 99 #include "chrome/browser/ui/window_sizer.h"
99 #include "chrome/browser/upgrade_detector.h" 100 #include "chrome/browser/upgrade_detector.h"
100 #include "chrome/browser/web_applications/web_app.h" 101 #include "chrome/browser/web_applications/web_app.h"
101 #include "chrome/common/chrome_constants.h" 102 #include "chrome/common/chrome_constants.h"
102 #include "chrome/common/chrome_switches.h" 103 #include "chrome/common/chrome_switches.h"
103 #include "chrome/common/extensions/extension.h" 104 #include "chrome/common/extensions/extension.h"
104 #include "chrome/common/extensions/extension_constants.h" 105 #include "chrome/common/extensions/extension_constants.h"
105 #include "chrome/common/extensions/extension_messages.h" 106 #include "chrome/common/extensions/extension_messages.h"
106 #include "chrome/common/pref_names.h" 107 #include "chrome/common/pref_names.h"
107 #include "chrome/common/profiling.h" 108 #include "chrome/common/profiling.h"
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 // On X11, setting fullscreen mode is an async call to the X server, which 1594 // On X11, setting fullscreen mode is an async call to the X server, which
1594 // may or may not support fullscreen mode. 1595 // may or may not support fullscreen mode.
1595 #if !defined(USE_X11) 1596 #if !defined(USE_X11)
1596 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); 1597 UpdateCommandsForFullscreenMode(window_->IsFullscreen());
1597 #endif 1598 #endif
1598 } 1599 }
1599 1600
1600 #if defined(OS_CHROMEOS) 1601 #if defined(OS_CHROMEOS)
1601 void Browser::Search() { 1602 void Browser::Search() {
1602 // If the NTP is showing, close it. 1603 // If the NTP is showing, close it.
1603 if (StartsWithASCII(GetSelectedTabContents()->GetURL().spec(), 1604 const GURL& url = GetSelectedTabContents()->GetURL();
1604 chrome::kChromeUINewTabURL, true)) { 1605 if (web_ui_util::ChromeURLHostEquals(url, chrome::kChromeUINewTabHost)) {
1605 CloseTab(); 1606 CloseTab();
1606 return; 1607 return;
1607 } 1608 }
1608 1609
1609 // Exit fullscreen to show omnibox. 1610 // Exit fullscreen to show omnibox.
1610 if (window_->IsFullscreen()) { 1611 if (window_->IsFullscreen()) {
1611 ToggleFullscreenMode(); 1612 ToggleFullscreenMode();
1612 // ToggleFullscreenMode is asynchronous, so we don't have omnibox 1613 // ToggleFullscreenMode is asynchronous, so we don't have omnibox
1613 // visible at this point. Wait for next event cycle which toggles 1614 // visible at this point. Wait for next event cycle which toggles
1614 // the visibility of omnibox before creating new tab. 1615 // the visibility of omnibox before creating new tab.
(...skipping 3022 matching lines...) Expand 10 before | Expand all | Expand 10 after
4637 TabContents* current_tab = GetSelectedTabContents(); 4638 TabContents* current_tab = GetSelectedTabContents();
4638 if (current_tab) { 4639 if (current_tab) {
4639 content_restrictions = current_tab->content_restrictions(); 4640 content_restrictions = current_tab->content_restrictions();
4640 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); 4641 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry();
4641 // See comment in UpdateCommandsForTabState about why we call url(). 4642 // See comment in UpdateCommandsForTabState about why we call url().
4642 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) 4643 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL()))
4643 content_restrictions |= CONTENT_RESTRICTION_SAVE; 4644 content_restrictions |= CONTENT_RESTRICTION_SAVE;
4644 } 4645 }
4645 return content_restrictions; 4646 return content_restrictions;
4646 } 4647 }
OLDNEW
« no previous file with comments | « chrome/browser/tabs/tab_strip_model.cc ('k') | chrome/browser/ui/gtk/browser_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698