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

Side by Side Diff: chrome/browser/translate/chrome_translate_client.cc

Issue 1659203002: Remove HostDesktopType from FindLastActive[WithProfile] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 4 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/translate/chrome_translate_client.h" 5 #include "chrome/browser/translate/chrome_translate_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 if (web_contents() != browser->tab_strip_model()->GetActiveWebContents()) 326 if (web_contents() != browser->tab_strip_model()->GetActiveWebContents())
327 return; 327 return;
328 328
329 // This ShowBubble function is also used for upating the existing bubble. 329 // This ShowBubble function is also used for upating the existing bubble.
330 // However, with the bubble shown, any browser windows are NOT activated 330 // However, with the bubble shown, any browser windows are NOT activated
331 // because the bubble takes the focus from the other widgets including the 331 // because the bubble takes the focus from the other widgets including the
332 // browser windows. So it is checked that |browser| is the last activated 332 // browser windows. So it is checked that |browser| is the last activated
333 // browser, not is now activated. 333 // browser, not is now activated.
334 if (browser != 334 if (browser != chrome::FindLastActive())
335 chrome::FindLastActiveWithHostDesktopType(browser->host_desktop_type())) {
336 return; 335 return;
337 }
338 336
339 // During auto-translating, the bubble should not be shown. 337 // During auto-translating, the bubble should not be shown.
340 if (step == translate::TRANSLATE_STEP_TRANSLATING || 338 if (step == translate::TRANSLATE_STEP_TRANSLATING ||
341 step == translate::TRANSLATE_STEP_AFTER_TRANSLATE) { 339 step == translate::TRANSLATE_STEP_AFTER_TRANSLATE) {
342 if (GetLanguageState().InTranslateNavigation()) 340 if (GetLanguageState().InTranslateNavigation())
343 return; 341 return;
344 } 342 }
345 343
346 TranslateBubbleFactory::Show( 344 TranslateBubbleFactory::Show(
347 browser->window(), web_contents(), step, error_type); 345 browser->window(), web_contents(), step, error_type);
348 #else 346 #else
349 NOTREACHED(); 347 NOTREACHED();
350 #endif 348 #endif
351 } 349 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/srt_global_error_win.cc ('k') | chrome/browser/ui/ash/system_tray_delegate_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698