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

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

Issue 16233: Ctrl+U should show up view-source on Application shortcuts (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | « no previous file | no next file » | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <shellapi.h> 6 #include <shellapi.h>
7 7
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 } 768 }
769 } 769 }
770 770
771 void Browser::ViewSource() { 771 void Browser::ViewSource() {
772 UserMetrics::RecordAction(L"ViewSource", profile_); 772 UserMetrics::RecordAction(L"ViewSource", profile_);
773 773
774 TabContents* current_tab = GetSelectedTabContents(); 774 TabContents* current_tab = GetSelectedTabContents();
775 NavigationEntry* entry = current_tab->controller()->GetLastCommittedEntry(); 775 NavigationEntry* entry = current_tab->controller()->GetLastCommittedEntry();
776 if (entry) { 776 if (entry) {
777 GURL url("view-source:" + entry->url().spec()); 777 GURL url("view-source:" + entry->url().spec());
778 AddTabWithURL(url, GURL(), PageTransition::LINK, true, NULL); 778 if (type_ == TYPE_APP)
779 OpenURL(url, GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK);
780 else
781 AddTabWithURL(url, GURL(), PageTransition::LINK, true, NULL);
779 } 782 }
780 } 783 }
781 784
782 void Browser::ClosePopups() { 785 void Browser::ClosePopups() {
783 UserMetrics::RecordAction(L"CloseAllSuppressedPopups", profile_); 786 UserMetrics::RecordAction(L"CloseAllSuppressedPopups", profile_);
784 GetSelectedTabContents()->CloseAllSuppressedPopups(); 787 GetSelectedTabContents()->CloseAllSuppressedPopups();
785 } 788 }
786 789
787 void Browser::Print() { 790 void Browser::Print() {
788 UserMetrics::RecordAction(L"PrintPreview", profile_); 791 UserMetrics::RecordAction(L"PrintPreview", profile_);
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 2401
2399 // We need to register the window position pref. 2402 // We need to register the window position pref.
2400 std::wstring window_pref(prefs::kBrowserWindowPlacement); 2403 std::wstring window_pref(prefs::kBrowserWindowPlacement);
2401 window_pref.append(L"_"); 2404 window_pref.append(L"_");
2402 window_pref.append(app_name); 2405 window_pref.append(app_name);
2403 PrefService* prefs = g_browser_process->local_state(); 2406 PrefService* prefs = g_browser_process->local_state();
2404 DCHECK(prefs); 2407 DCHECK(prefs);
2405 2408
2406 prefs->RegisterDictionaryPref(window_pref.c_str()); 2409 prefs->RegisterDictionaryPref(window_pref.c_str());
2407 } 2410 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698