Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 689 | 689 |
| 690 void ShowChromeToMobileBubble(Browser* browser) { | 690 void ShowChromeToMobileBubble(Browser* browser) { |
| 691 // Only show the bubble if the window is active, otherwise we may get into | 691 // Only show the bubble if the window is active, otherwise we may get into |
| 692 // weird situations where the bubble is deleted as soon as it is shown. | 692 // weird situations where the bubble is deleted as soon as it is shown. |
| 693 if (browser->window()->IsActive()) | 693 if (browser->window()->IsActive()) |
| 694 browser->window()->ShowChromeToMobileBubble(); | 694 browser->window()->ShowChromeToMobileBubble(); |
| 695 } | 695 } |
| 696 | 696 |
| 697 void ShareCurrentPage(Browser* browser) { | 697 void ShareCurrentPage(Browser* browser) { |
| 698 const GURL& current_url = chrome::GetActiveWebContents(browser)->GetURL(); | 698 const GURL& current_url = chrome::GetActiveWebContents(browser)->GetURL(); |
| 699 content::RecordAction(UserMetricsAction("ActionBox_SharePage")); | |
|
skare_
2012/10/15 21:26:26
my incoming change http://codereview.chromium.org/
| |
| 699 webkit_glue::WebIntentData intent_data( | 700 webkit_glue::WebIntentData intent_data( |
| 700 ASCIIToUTF16("http://webintents.org/share"), | 701 ASCIIToUTF16("http://webintents.org/share"), |
| 701 ASCIIToUTF16("text/uri-list"), | 702 ASCIIToUTF16("text/uri-list"), |
| 702 UTF8ToUTF16(current_url.spec())); | 703 UTF8ToUTF16(current_url.spec())); |
| 703 scoped_ptr<content::WebIntentsDispatcher> dispatcher( | 704 scoped_ptr<content::WebIntentsDispatcher> dispatcher( |
| 704 content::WebIntentsDispatcher::Create(intent_data)); | 705 content::WebIntentsDispatcher::Create(intent_data)); |
| 705 static_cast<content::WebContentsDelegate*>(browser)-> | 706 static_cast<content::WebContentsDelegate*>(browser)-> |
| 706 WebIntentDispatch(NULL, dispatcher.release()); | 707 WebIntentDispatch(NULL, dispatcher.release()); |
| 707 } | 708 } |
| 708 | 709 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1074 BrowserCommandsTabContentsCreator::CreateTabContents(contents); | 1075 BrowserCommandsTabContentsCreator::CreateTabContents(contents); |
| 1075 } | 1076 } |
| 1076 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); | 1077 app_browser->tab_strip_model()->AppendTabContents(tab_contents, true); |
| 1077 | 1078 |
| 1078 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1079 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1079 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1080 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1080 app_browser->window()->Show(); | 1081 app_browser->window()->Show(); |
| 1081 } | 1082 } |
| 1082 | 1083 |
| 1083 } // namespace chrome | 1084 } // namespace chrome |
| OLD | NEW |