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

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

Issue 107033003: Stop using GetDefaultProfile() in Chrome OS implementation of platform_util::OpenExternal() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove is_valid check Created 7 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_commands.h" 5 #include "chrome/browser/ui/browser_commands.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 void EmailPageLocation(Browser* browser) { 807 void EmailPageLocation(Browser* browser) {
808 content::RecordAction(UserMetricsAction("EmailPageLocation")); 808 content::RecordAction(UserMetricsAction("EmailPageLocation"));
809 WebContents* wc = browser->tab_strip_model()->GetActiveWebContents(); 809 WebContents* wc = browser->tab_strip_model()->GetActiveWebContents();
810 DCHECK(wc); 810 DCHECK(wc);
811 811
812 std::string title = net::EscapeQueryParamValue( 812 std::string title = net::EscapeQueryParamValue(
813 UTF16ToUTF8(wc->GetTitle()), false); 813 UTF16ToUTF8(wc->GetTitle()), false);
814 std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false); 814 std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false);
815 std::string mailto = std::string("mailto:?subject=Fwd:%20") + 815 std::string mailto = std::string("mailto:?subject=Fwd:%20") +
816 title + "&body=%0A%0A" + page_url; 816 title + "&body=%0A%0A" + page_url;
817 platform_util::OpenExternal(GURL(mailto)); 817 platform_util::OpenExternal(browser->profile(), GURL(mailto));
818 } 818 }
819 819
820 bool CanEmailPageLocation(const Browser* browser) { 820 bool CanEmailPageLocation(const Browser* browser) {
821 return browser->toolbar_model()->ShouldDisplayURL() && 821 return browser->toolbar_model()->ShouldDisplayURL() &&
822 browser->tab_strip_model()->GetActiveWebContents()->GetURL().is_valid(); 822 browser->tab_strip_model()->GetActiveWebContents()->GetURL().is_valid();
823 } 823 }
824 824
825 void Cut(Browser* browser) { 825 void Cut(Browser* browser) {
826 content::RecordAction(UserMetricsAction("Cut")); 826 content::RecordAction(UserMetricsAction("Cut"));
827 browser->window()->Cut(); 827 browser->window()->Cut();
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(), 1162 Browser::TYPE_POPUP, app_name, gfx::Rect(), browser->profile(),
1163 browser->host_desktop_type())); 1163 browser->host_desktop_type()));
1164 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1164 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1165 1165
1166 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1166 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1167 contents->GetRenderViewHost()->SyncRendererPrefs(); 1167 contents->GetRenderViewHost()->SyncRendererPrefs();
1168 app_browser->window()->Show(); 1168 app_browser->window()->Show();
1169 } 1169 }
1170 1170
1171 } // namespace chrome 1171 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/apps/chrome_shell_window_delegate.cc ('k') | chrome/browser/ui/cocoa/external_protocol_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698