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

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

Issue 11416013: Move RequestPpapiBrokerPermission from WebContentsObserver to WebContentsDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 1 month 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) 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.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // defined(OS_WIN) 10 #endif // defined(OS_WIN)
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #include "chrome/browser/google/google_url_tracker.h" 60 #include "chrome/browser/google/google_url_tracker.h"
61 #include "chrome/browser/infobars/infobar_tab_helper.h" 61 #include "chrome/browser/infobars/infobar_tab_helper.h"
62 #include "chrome/browser/intents/device_attached_intent_source.h" 62 #include "chrome/browser/intents/device_attached_intent_source.h"
63 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" 63 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h"
64 #include "chrome/browser/intents/web_intents_reporting.h" 64 #include "chrome/browser/intents/web_intents_reporting.h"
65 #include "chrome/browser/intents/web_intents_util.h" 65 #include "chrome/browser/intents/web_intents_util.h"
66 #include "chrome/browser/lifetime/application_lifetime.h" 66 #include "chrome/browser/lifetime/application_lifetime.h"
67 #include "chrome/browser/media/media_stream_devices_controller.h" 67 #include "chrome/browser/media/media_stream_devices_controller.h"
68 #include "chrome/browser/net/url_fixer_upper.h" 68 #include "chrome/browser/net/url_fixer_upper.h"
69 #include "chrome/browser/notifications/notification_ui_manager.h" 69 #include "chrome/browser/notifications/notification_ui_manager.h"
70 #include "chrome/browser/pepper_broker_infobar_delegate.h"
70 #include "chrome/browser/platform_util.h" 71 #include "chrome/browser/platform_util.h"
71 #include "chrome/browser/prefs/incognito_mode_prefs.h" 72 #include "chrome/browser/prefs/incognito_mode_prefs.h"
72 #include "chrome/browser/prefs/pref_service.h" 73 #include "chrome/browser/prefs/pref_service.h"
73 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" 74 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h"
74 #include "chrome/browser/printing/print_preview_tab_controller.h" 75 #include "chrome/browser/printing/print_preview_tab_controller.h"
75 #include "chrome/browser/profiles/profile.h" 76 #include "chrome/browser/profiles/profile.h"
76 #include "chrome/browser/profiles/profile_destroyer.h" 77 #include "chrome/browser/profiles/profile_destroyer.h"
77 #include "chrome/browser/profiles/profile_manager.h" 78 #include "chrome/browser/profiles/profile_manager.h"
78 #include "chrome/browser/profiles/profile_metrics.h" 79 #include "chrome/browser/profiles/profile_metrics.h"
79 #include "chrome/browser/repost_form_warning_controller.h" 80 #include "chrome/browser/repost_form_warning_controller.h"
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 fullscreen_controller_->LostMouseLock(); 1739 fullscreen_controller_->LostMouseLock();
1739 } 1740 }
1740 1741
1741 void Browser::RequestMediaAccessPermission( 1742 void Browser::RequestMediaAccessPermission(
1742 content::WebContents* web_contents, 1743 content::WebContents* web_contents,
1743 const content::MediaStreamRequest* request, 1744 const content::MediaStreamRequest* request,
1744 const content::MediaResponseCallback& callback) { 1745 const content::MediaResponseCallback& callback) {
1745 RequestMediaAccessPermissionHelper(web_contents, request, callback); 1746 RequestMediaAccessPermissionHelper(web_contents, request, callback);
1746 } 1747 }
1747 1748
1749 void Browser::RequestPpapiBrokerPermission(
1750 WebContents* web_contents,
1751 const GURL& url,
1752 const FilePath& plugin_path,
1753 const base::Callback<void(bool)>& callback) {
1754 PepperBrokerInfoBarDelegate::Show(web_contents, url, plugin_path, callback);
1755 }
1756
1748 /////////////////////////////////////////////////////////////////////////////// 1757 ///////////////////////////////////////////////////////////////////////////////
1749 // Browser, CoreTabHelperDelegate implementation: 1758 // Browser, CoreTabHelperDelegate implementation:
1750 1759
1751 void Browser::SwapTabContents(content::WebContents* old_contents, 1760 void Browser::SwapTabContents(content::WebContents* old_contents,
1752 content::WebContents* new_contents) { 1761 content::WebContents* new_contents) {
1753 int index = tab_strip_model_->GetIndexOfWebContents(old_contents); 1762 int index = tab_strip_model_->GetIndexOfWebContents(old_contents);
1754 DCHECK_NE(TabStripModel::kNoTab, index); 1763 DCHECK_NE(TabStripModel::kNoTab, index);
1755 TabContents* new_tab_contents = TabContents::FromWebContents(new_contents); 1764 TabContents* new_tab_contents = TabContents::FromWebContents(new_contents);
1756 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents); 1765 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents);
1757 } 1766 }
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 if (contents && !allow_js_access) { 2361 if (contents && !allow_js_access) {
2353 contents->web_contents()->GetController().LoadURL( 2362 contents->web_contents()->GetController().LoadURL(
2354 target_url, 2363 target_url,
2355 content::Referrer(), 2364 content::Referrer(),
2356 content::PAGE_TRANSITION_LINK, 2365 content::PAGE_TRANSITION_LINK,
2357 std::string()); // No extra headers. 2366 std::string()); // No extra headers.
2358 } 2367 }
2359 2368
2360 return contents != NULL; 2369 return contents != NULL;
2361 } 2370 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698