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

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

Issue 7068007: Revise about: and chrome: url handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update special_tabs.py from Nirnimesh's codereview.chromium.org/6995057/. Created 9 years, 6 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 #include "chrome/browser/ui/panels/panel_manager.h" 89 #include "chrome/browser/ui/panels/panel_manager.h"
90 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 90 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
91 #include "chrome/browser/ui/status_bubble.h" 91 #include "chrome/browser/ui/status_bubble.h"
92 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 92 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
93 #include "chrome/browser/ui/tabs/dock_info.h" 93 #include "chrome/browser/ui/tabs/dock_info.h"
94 #include "chrome/browser/ui/tabs/tab_menu_model.h" 94 #include "chrome/browser/ui/tabs/tab_menu_model.h"
95 #include "chrome/browser/ui/web_applications/web_app_ui.h" 95 #include "chrome/browser/ui/web_applications/web_app_ui.h"
96 #include "chrome/browser/ui/webui/active_downloads_ui.h" 96 #include "chrome/browser/ui/webui/active_downloads_ui.h"
97 #include "chrome/browser/ui/webui/bug_report_ui.h" 97 #include "chrome/browser/ui/webui/bug_report_ui.h"
98 #include "chrome/browser/ui/webui/options/content_settings_handler.h" 98 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
99 #include "chrome/browser/ui/webui/web_ui_util.h"
100 #include "chrome/browser/ui/window_sizer.h" 99 #include "chrome/browser/ui/window_sizer.h"
101 #include "chrome/browser/upgrade_detector.h" 100 #include "chrome/browser/upgrade_detector.h"
102 #include "chrome/browser/web_applications/web_app.h" 101 #include "chrome/browser/web_applications/web_app.h"
103 #include "chrome/common/chrome_constants.h" 102 #include "chrome/common/chrome_constants.h"
104 #include "chrome/common/chrome_switches.h" 103 #include "chrome/common/chrome_switches.h"
105 #include "chrome/common/extensions/extension.h" 104 #include "chrome/common/extensions/extension.h"
106 #include "chrome/common/extensions/extension_constants.h" 105 #include "chrome/common/extensions/extension_constants.h"
107 #include "chrome/common/extensions/extension_messages.h" 106 #include "chrome/common/extensions/extension_messages.h"
108 #include "chrome/common/pref_names.h" 107 #include "chrome/common/pref_names.h"
109 #include "chrome/common/profiling.h" 108 #include "chrome/common/profiling.h"
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 // may or may not support fullscreen mode. 1604 // may or may not support fullscreen mode.
1606 #if !defined(USE_X11) 1605 #if !defined(USE_X11)
1607 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); 1606 UpdateCommandsForFullscreenMode(window_->IsFullscreen());
1608 #endif 1607 #endif
1609 } 1608 }
1610 1609
1611 #if defined(OS_CHROMEOS) 1610 #if defined(OS_CHROMEOS)
1612 void Browser::Search() { 1611 void Browser::Search() {
1613 // If the NTP is showing, close it. 1612 // If the NTP is showing, close it.
1614 const GURL& url = GetSelectedTabContents()->GetURL(); 1613 const GURL& url = GetSelectedTabContents()->GetURL();
1615 if (web_ui_util::ChromeURLHostEquals(url, chrome::kChromeUINewTabHost)) { 1614 if (url.SchemeIs(chrome::kChromeUIScheme) &&
1615 url.host() == chrome::kChromeUINewTabHost) {
1616 CloseTab(); 1616 CloseTab();
1617 return; 1617 return;
1618 } 1618 }
1619 1619
1620 // Exit fullscreen to show omnibox. 1620 // Exit fullscreen to show omnibox.
1621 if (window_->IsFullscreen()) { 1621 if (window_->IsFullscreen()) {
1622 ToggleFullscreenMode(); 1622 ToggleFullscreenMode();
1623 // ToggleFullscreenMode is asynchronous, so we don't have omnibox 1623 // ToggleFullscreenMode is asynchronous, so we don't have omnibox
1624 // visible at this point. Wait for next event cycle which toggles 1624 // visible at this point. Wait for next event cycle which toggles
1625 // the visibility of omnibox before creating new tab. 1625 // the visibility of omnibox before creating new tab.
(...skipping 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after
4695 TabContents* current_tab = GetSelectedTabContents(); 4695 TabContents* current_tab = GetSelectedTabContents();
4696 if (current_tab) { 4696 if (current_tab) {
4697 content_restrictions = current_tab->content_restrictions(); 4697 content_restrictions = current_tab->content_restrictions();
4698 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); 4698 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry();
4699 // See comment in UpdateCommandsForTabState about why we call url(). 4699 // See comment in UpdateCommandsForTabState about why we call url().
4700 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) 4700 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL()))
4701 content_restrictions |= CONTENT_RESTRICTION_SAVE; 4701 content_restrictions |= CONTENT_RESTRICTION_SAVE;
4702 } 4702 }
4703 return content_restrictions; 4703 return content_restrictions;
4704 } 4704 }
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