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

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: Address comments and add extra crash URL checks. 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
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 #include "chrome/browser/ui/panels/panel_manager.h" 87 #include "chrome/browser/ui/panels/panel_manager.h"
88 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" 88 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h"
89 #include "chrome/browser/ui/status_bubble.h" 89 #include "chrome/browser/ui/status_bubble.h"
90 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 90 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
91 #include "chrome/browser/ui/tabs/dock_info.h" 91 #include "chrome/browser/ui/tabs/dock_info.h"
92 #include "chrome/browser/ui/tabs/tab_menu_model.h" 92 #include "chrome/browser/ui/tabs/tab_menu_model.h"
93 #include "chrome/browser/ui/web_applications/web_app_ui.h" 93 #include "chrome/browser/ui/web_applications/web_app_ui.h"
94 #include "chrome/browser/ui/webui/active_downloads_ui.h" 94 #include "chrome/browser/ui/webui/active_downloads_ui.h"
95 #include "chrome/browser/ui/webui/bug_report_ui.h" 95 #include "chrome/browser/ui/webui/bug_report_ui.h"
96 #include "chrome/browser/ui/webui/options/content_settings_handler.h" 96 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
97 #include "chrome/browser/ui/webui/web_ui_util.h"
98 #include "chrome/browser/ui/window_sizer.h" 97 #include "chrome/browser/ui/window_sizer.h"
99 #include "chrome/browser/upgrade_detector.h" 98 #include "chrome/browser/upgrade_detector.h"
100 #include "chrome/browser/web_applications/web_app.h" 99 #include "chrome/browser/web_applications/web_app.h"
101 #include "chrome/common/chrome_constants.h" 100 #include "chrome/common/chrome_constants.h"
102 #include "chrome/common/chrome_switches.h" 101 #include "chrome/common/chrome_switches.h"
103 #include "chrome/common/extensions/extension.h" 102 #include "chrome/common/extensions/extension.h"
104 #include "chrome/common/extensions/extension_constants.h" 103 #include "chrome/common/extensions/extension_constants.h"
105 #include "chrome/common/extensions/extension_messages.h" 104 #include "chrome/common/extensions/extension_messages.h"
106 #include "chrome/common/pref_names.h" 105 #include "chrome/common/pref_names.h"
107 #include "chrome/common/profiling.h" 106 #include "chrome/common/profiling.h"
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 // may or may not support fullscreen mode. 1593 // may or may not support fullscreen mode.
1595 #if !defined(USE_X11) 1594 #if !defined(USE_X11)
1596 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); 1595 UpdateCommandsForFullscreenMode(window_->IsFullscreen());
1597 #endif 1596 #endif
1598 } 1597 }
1599 1598
1600 #if defined(OS_CHROMEOS) 1599 #if defined(OS_CHROMEOS)
1601 void Browser::Search() { 1600 void Browser::Search() {
1602 // If the NTP is showing, close it. 1601 // If the NTP is showing, close it.
1603 const GURL& url = GetSelectedTabContents()->GetURL(); 1602 const GURL& url = GetSelectedTabContents()->GetURL();
1604 if (web_ui_util::ChromeURLHostEquals(url, chrome::kChromeUINewTabHost)) { 1603 if (url.SchemeIs(chrome::kChromeUIScheme) &&
1604 url.host() == chrome::kChromeUINewTabHost) {
1605 CloseTab(); 1605 CloseTab();
1606 return; 1606 return;
1607 } 1607 }
1608 1608
1609 // Exit fullscreen to show omnibox. 1609 // Exit fullscreen to show omnibox.
1610 if (window_->IsFullscreen()) { 1610 if (window_->IsFullscreen()) {
1611 ToggleFullscreenMode(); 1611 ToggleFullscreenMode();
1612 // ToggleFullscreenMode is asynchronous, so we don't have omnibox 1612 // ToggleFullscreenMode is asynchronous, so we don't have omnibox
1613 // visible at this point. Wait for next event cycle which toggles 1613 // visible at this point. Wait for next event cycle which toggles
1614 // the visibility of omnibox before creating new tab. 1614 // the visibility of omnibox before creating new tab.
(...skipping 3027 matching lines...) Expand 10 before | Expand all | Expand 10 after
4642 TabContents* current_tab = GetSelectedTabContents(); 4642 TabContents* current_tab = GetSelectedTabContents();
4643 if (current_tab) { 4643 if (current_tab) {
4644 content_restrictions = current_tab->content_restrictions(); 4644 content_restrictions = current_tab->content_restrictions();
4645 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); 4645 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry();
4646 // See comment in UpdateCommandsForTabState about why we call url(). 4646 // See comment in UpdateCommandsForTabState about why we call url().
4647 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) 4647 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL()))
4648 content_restrictions |= CONTENT_RESTRICTION_SAVE; 4648 content_restrictions |= CONTENT_RESTRICTION_SAVE;
4649 } 4649 }
4650 return content_restrictions; 4650 return content_restrictions;
4651 } 4651 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698