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

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

Issue 1135693006: Fix X11DesktopHandler::ActivateWindow on Unity for known user gestures Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
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.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 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 chrome::AddWebContents(this, source, new_contents, disposition, initial_rect, 1444 chrome::AddWebContents(this, source, new_contents, disposition, initial_rect,
1445 user_gesture, was_blocked); 1445 user_gesture, was_blocked);
1446 } 1446 }
1447 1447
1448 void Browser::ActivateContents(WebContents* contents) { 1448 void Browser::ActivateContents(WebContents* contents) {
1449 tab_strip_model_->ActivateTabAt( 1449 tab_strip_model_->ActivateTabAt(
1450 tab_strip_model_->GetIndexOfWebContents(contents), false); 1450 tab_strip_model_->GetIndexOfWebContents(contents), false);
1451 window_->Activate(); 1451 window_->Activate();
1452 } 1452 }
1453 1453
1454 void Browser::ActivateContentsForUserGesture(WebContents* contents) {
1455 tab_strip_model_->ActivateTabAt(
1456 tab_strip_model_->GetIndexOfWebContents(contents), false);
1457 window_->ActivateForUserGesture();
1458 }
1459
1454 void Browser::DeactivateContents(WebContents* contents) { 1460 void Browser::DeactivateContents(WebContents* contents) {
1455 window_->Deactivate(); 1461 window_->Deactivate();
1456 } 1462 }
1457 1463
1458 void Browser::LoadingStateChanged(WebContents* source, 1464 void Browser::LoadingStateChanged(WebContents* source,
1459 bool to_different_document) { 1465 bool to_different_document) {
1460 window_->UpdateLoadingAnimations(tab_strip_model_->TabsAreLoading()); 1466 window_->UpdateLoadingAnimations(tab_strip_model_->TabsAreLoading());
1461 window_->UpdateTitleBar(); 1467 window_->UpdateTitleBar();
1462 1468
1463 WebContents* selected_contents = tab_strip_model_->GetActiveWebContents(); 1469 WebContents* selected_contents = tab_strip_model_->GetActiveWebContents();
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 if (contents && !allow_js_access) { 2609 if (contents && !allow_js_access) {
2604 contents->web_contents()->GetController().LoadURL( 2610 contents->web_contents()->GetController().LoadURL(
2605 target_url, 2611 target_url,
2606 content::Referrer(), 2612 content::Referrer(),
2607 ui::PAGE_TRANSITION_LINK, 2613 ui::PAGE_TRANSITION_LINK,
2608 std::string()); // No extra headers. 2614 std::string()); // No extra headers.
2609 } 2615 }
2610 2616
2611 return contents != NULL; 2617 return contents != NULL;
2612 } 2618 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698