OLD | NEW |
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.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 // An incognito profile is no longer needed, this indirectly frees | 557 // An incognito profile is no longer needed, this indirectly frees |
558 // its cache and cookies once it gets destroyed at the appropriate time. | 558 // its cache and cookies once it gets destroyed at the appropriate time. |
559 ProfileDestroyer::DestroyProfileWhenAppropriate(profile_); | 559 ProfileDestroyer::DestroyProfileWhenAppropriate(profile_); |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 // There may be pending file dialogs, we need to tell them that we've gone | 563 // There may be pending file dialogs, we need to tell them that we've gone |
564 // away so they don't try and call back to us. | 564 // away so they don't try and call back to us. |
565 if (select_file_dialog_.get()) | 565 if (select_file_dialog_.get()) |
566 select_file_dialog_->ListenerDestroyed(); | 566 select_file_dialog_->ListenerDestroyed(); |
567 | |
568 } | 567 } |
569 | 568 |
570 /////////////////////////////////////////////////////////////////////////////// | 569 /////////////////////////////////////////////////////////////////////////////// |
571 // Getters & Setters | 570 // Getters & Setters |
572 | 571 |
573 ChromeBubbleManager* Browser::GetBubbleManager() { | 572 ChromeBubbleManager* Browser::GetBubbleManager() { |
574 if (!bubble_manager_) | 573 if (!bubble_manager_) |
575 bubble_manager_.reset(new ChromeBubbleManager(tab_strip_model_.get())); | 574 bubble_manager_.reset(new ChromeBubbleManager(tab_strip_model_.get())); |
576 return bubble_manager_.get(); | 575 return bubble_manager_.get(); |
577 } | 576 } |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 if (rwhv) { | 1302 if (rwhv) { |
1304 validation_message_bubble_->SetPositionRelativeToAnchor( | 1303 validation_message_bubble_->SetPositionRelativeToAnchor( |
1305 rwhv->GetRenderWidgetHost(), anchor_in_root_view); | 1304 rwhv->GetRenderWidgetHost(), anchor_in_root_view); |
1306 } | 1305 } |
1307 } | 1306 } |
1308 | 1307 |
1309 bool Browser::PreHandleGestureEvent(content::WebContents* source, | 1308 bool Browser::PreHandleGestureEvent(content::WebContents* source, |
1310 const blink::WebGestureEvent& event) { | 1309 const blink::WebGestureEvent& event) { |
1311 // Disable pinch zooming in undocked dev tools window due to poor UX. | 1310 // Disable pinch zooming in undocked dev tools window due to poor UX. |
1312 if (app_name() == DevToolsWindow::kDevToolsApp) | 1311 if (app_name() == DevToolsWindow::kDevToolsApp) |
1313 return event.GetType() == blink::WebGestureEvent::kGesturePinchBegin || | 1312 return blink::WebInputEvent::IsPinchGestureEventType(event.GetType()); |
1314 event.GetType() == blink::WebGestureEvent::kGesturePinchUpdate || | |
1315 event.GetType() == blink::WebGestureEvent::kGesturePinchEnd; | |
1316 | |
1317 return false; | 1313 return false; |
1318 } | 1314 } |
1319 | 1315 |
1320 bool Browser::CanDragEnter(content::WebContents* source, | 1316 bool Browser::CanDragEnter(content::WebContents* source, |
1321 const content::DropData& data, | 1317 const content::DropData& data, |
1322 blink::WebDragOperationsMask operations_allowed) { | 1318 blink::WebDragOperationsMask operations_allowed) { |
1323 // Disallow drag-and-drop navigation for Settings windows which do not support | 1319 // Disallow drag-and-drop navigation for Settings windows which do not support |
1324 // external navigation. | 1320 // external navigation. |
1325 if ((operations_allowed & blink::kWebDragOperationLink) && | 1321 if ((operations_allowed & blink::kWebDragOperationLink) && |
1326 chrome::SettingsWindowManager::GetInstance()->IsSettingsBrowser(this)) { | 1322 chrome::SettingsWindowManager::GetInstance()->IsSettingsBrowser(this)) { |
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2628 // new window later, thus we need to navigate the window now. | 2624 // new window later, thus we need to navigate the window now. |
2629 if (contents) { | 2625 if (contents) { |
2630 contents->web_contents()->GetController().LoadURL( | 2626 contents->web_contents()->GetController().LoadURL( |
2631 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2627 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
2632 std::string()); // No extra headers. | 2628 std::string()); // No extra headers. |
2633 } | 2629 } |
2634 } | 2630 } |
2635 | 2631 |
2636 return contents != NULL; | 2632 return contents != NULL; |
2637 } | 2633 } |
OLD | NEW |