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.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 // OS_WIN | 10 #endif // OS_WIN |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 #include "chrome/browser/ui/extensions/shell_window.h" | 111 #include "chrome/browser/ui/extensions/shell_window.h" |
112 #include "chrome/browser/ui/find_bar/find_bar.h" | 112 #include "chrome/browser/ui/find_bar/find_bar.h" |
113 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 113 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
114 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 114 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
115 #include "chrome/browser/ui/fullscreen_controller.h" | 115 #include "chrome/browser/ui/fullscreen_controller.h" |
116 #include "chrome/browser/ui/global_error.h" | 116 #include "chrome/browser/ui/global_error.h" |
117 #include "chrome/browser/ui/global_error_service.h" | 117 #include "chrome/browser/ui/global_error_service.h" |
118 #include "chrome/browser/ui/global_error_service_factory.h" | 118 #include "chrome/browser/ui/global_error_service_factory.h" |
119 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 119 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
120 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 120 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
121 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | |
121 #include "chrome/browser/ui/omnibox/location_bar.h" | 122 #include "chrome/browser/ui/omnibox/location_bar.h" |
122 #include "chrome/browser/ui/panels/panel.h" | 123 #include "chrome/browser/ui/panels/panel.h" |
123 #include "chrome/browser/ui/panels/panel_manager.h" | 124 #include "chrome/browser/ui/panels/panel_manager.h" |
124 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 125 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
125 #include "chrome/browser/ui/status_bubble.h" | 126 #include "chrome/browser/ui/status_bubble.h" |
126 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" | 127 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" |
127 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 128 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
128 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 129 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
129 #include "chrome/browser/ui/tabs/dock_info.h" | 130 #include "chrome/browser/ui/tabs/dock_info.h" |
130 #include "chrome/browser/ui/tabs/tab_finder.h" | 131 #include "chrome/browser/ui/tabs/tab_finder.h" |
(...skipping 3547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3678 bool last_unlocked_by_target) { | 3679 bool last_unlocked_by_target) { |
3679 fullscreen_controller_->RequestToLockMouse(tab, | 3680 fullscreen_controller_->RequestToLockMouse(tab, |
3680 user_gesture, | 3681 user_gesture, |
3681 last_unlocked_by_target); | 3682 last_unlocked_by_target); |
3682 } | 3683 } |
3683 | 3684 |
3684 void Browser::LostMouseLock() { | 3685 void Browser::LostMouseLock() { |
3685 fullscreen_controller_->LostMouseLock(); | 3686 fullscreen_controller_->LostMouseLock(); |
3686 } | 3687 } |
3687 | 3688 |
3689 void Browser::RequestMediaAccessPermission( | |
3690 content::WebContents* web_contents, | |
3691 const content::MediaStreamRequest* request, | |
3692 const content::MediaResponseCallback& callback) { | |
3693 TabContentsWrapper* tab = | |
jochen (gone - plz use gerrit)
2012/06/09 07:55:21
TabContentsWrapper is called TabContents these day
Evan Stade
2012/06/12 00:00:46
Done.
| |
3694 TabContentsWrapper::GetCurrentWrapperForContents(web_contents); | |
3695 DCHECK(tab); | |
jam
2012/06/11 05:31:57
nit: no need for dcheck, if it's null the crash in
Evan Stade
2012/06/12 00:00:46
I think of DCHECK as documentation. If we remove i
jam
2012/06/12 00:29:06
it seems that if a developer reading this assumes
| |
3696 | |
3697 InfoBarTabHelper* infobar_helper = tab->infobar_tab_helper(); | |
3698 InfoBarDelegate* old_infobar = NULL; | |
3699 for (size_t i = 0; i < infobar_helper->infobar_count() && !old_infobar; ++i) { | |
3700 old_infobar = | |
3701 infobar_helper->GetInfoBarDelegateAt(i)->AsMediaStreamInfoBarDelegate(); | |
3702 } | |
3703 | |
3704 InfoBarDelegate* infobar = new MediaStreamInfoBarDelegate(infobar_helper, | |
3705 request, | |
3706 callback); | |
3707 if (old_infobar) | |
3708 infobar_helper->ReplaceInfoBar(old_infobar, infobar); | |
3709 else | |
3710 infobar_helper->AddInfoBar(infobar); | |
3711 } | |
3712 | |
3688 /////////////////////////////////////////////////////////////////////////////// | 3713 /////////////////////////////////////////////////////////////////////////////// |
3689 // Browser, CoreTabHelperDelegate implementation: | 3714 // Browser, CoreTabHelperDelegate implementation: |
3690 | 3715 |
3691 void Browser::SwapTabContents(TabContents* old_tab_contents, | 3716 void Browser::SwapTabContents(TabContents* old_tab_contents, |
3692 TabContents* new_tab_contents) { | 3717 TabContents* new_tab_contents) { |
3693 int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents); | 3718 int index = tab_strip_model_->GetIndexOfTabContents(old_tab_contents); |
3694 DCHECK_NE(TabStripModel::kNoTab, index); | 3719 DCHECK_NE(TabStripModel::kNoTab, index); |
3695 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents); | 3720 tab_strip_model_->ReplaceTabContentsAt(index, new_tab_contents); |
3696 } | 3721 } |
3697 | 3722 |
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5172 if (contents && !allow_js_access) { | 5197 if (contents && !allow_js_access) { |
5173 contents->web_contents()->GetController().LoadURL( | 5198 contents->web_contents()->GetController().LoadURL( |
5174 target_url, | 5199 target_url, |
5175 content::Referrer(), | 5200 content::Referrer(), |
5176 content::PAGE_TRANSITION_LINK, | 5201 content::PAGE_TRANSITION_LINK, |
5177 std::string()); // No extra headers. | 5202 std::string()); // No extra headers. |
5178 } | 5203 } |
5179 | 5204 |
5180 return contents != NULL; | 5205 return contents != NULL; |
5181 } | 5206 } |
OLD | NEW |