| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |