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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Issue 2751583002: 🏡 Show correct BottomSheetContent toolbar when contents swapped (Closed)
Patch Set: Remove duplicate "and" Created 3 years, 9 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 package org.chromium.chrome.browser; 5 package org.chromium.chrome.browser;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.annotation.TargetApi; 8 import android.annotation.TargetApi;
9 import android.app.Activity; 9 import android.app.Activity;
10 import android.app.SearchManager; 10 import android.app.SearchManager;
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 424
425 toolbarContainerStub.setLayoutResource(controlContainerLayou tId); 425 toolbarContainerStub.setLayoutResource(controlContainerLayou tId);
426 View container = toolbarContainerStub.inflate(); 426 View container = toolbarContainerStub.inflate();
427 } 427 }
428 428
429 // It cannot be assumed that the result of toolbarContainerStub. inflate() will be 429 // It cannot be assumed that the result of toolbarContainerStub. inflate() will be
430 // the control container since it may be wrapped in another view . 430 // the control container since it may be wrapped in another view .
431 ControlContainer controlContainer = 431 ControlContainer controlContainer =
432 (ControlContainer) findViewById(R.id.control_container); 432 (ControlContainer) findViewById(R.id.control_container);
433 433
434 // Inflate the correct toolbar layout for the device.
435 int toolbarLayoutId = getToolbarLayoutId();
436 if (toolbarLayoutId != NO_TOOLBAR_LAYOUT && controlContainer != null) {
437 controlContainer.initWithToolbar(toolbarLayoutId);
438 }
439
434 // Get a handle to the bottom sheet if using the bottom control container. 440 // Get a handle to the bottom sheet if using the bottom control container.
435 if (controlContainerLayoutId == R.layout.bottom_control_containe r) { 441 if (controlContainerLayoutId == R.layout.bottom_control_containe r) {
436 View coordinator = findViewById(R.id.coordinator); 442 View coordinator = findViewById(R.id.coordinator);
437 mBottomSheet = (BottomSheet) findViewById(R.id.bottom_sheet) ; 443 mBottomSheet = (BottomSheet) findViewById(R.id.bottom_sheet) ;
438 mBottomSheet.init(coordinator, controlContainer.getView()); 444 mBottomSheet.init(coordinator, controlContainer.getView());
439 } 445 }
440
441 // Inflate the correct toolbar layout for the device.
442 int toolbarLayoutId = getToolbarLayoutId();
443 if (toolbarLayoutId != NO_TOOLBAR_LAYOUT && controlContainer != null) {
444 controlContainer.initWithToolbar(toolbarLayoutId);
445 }
446 } finally { 446 } finally {
447 StrictMode.setThreadPolicy(oldPolicy); 447 StrictMode.setThreadPolicy(oldPolicy);
448 } 448 }
449 } 449 }
450 TraceEvent.end("onCreate->setContentView()"); 450 TraceEvent.end("onCreate->setContentView()");
451 mInflateInitialLayoutDurationMs = SystemClock.elapsedRealtime() - begin; 451 mInflateInitialLayoutDurationMs = SystemClock.elapsedRealtime() - begin;
452 452
453 // Set the status bar color to black by default. This is an optimization for 453 // Set the status bar color to black by default. This is an optimization for
454 // Chrome not to draw under status and navigation bars when we use the d efault 454 // Chrome not to draw under status and navigation bars when we use the d efault
455 // black status bar 455 // black status bar
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 * draw over VR contents should be hidden in this call. 2117 * draw over VR contents should be hidden in this call.
2118 */ 2118 */
2119 public void onEnterVR() {} 2119 public void onEnterVR() {}
2120 2120
2121 /** 2121 /**
2122 * Called when VR mode using this activity is exited. Any state set for VR s hould be restored 2122 * Called when VR mode using this activity is exited. Any state set for VR s hould be restored
2123 * in this call, including showing 2D UI that was hidden. 2123 * in this call, including showing 2D UI that was hidden.
2124 */ 2124 */
2125 public void onExitVR() {} 2125 public void onExitVR() {}
2126 } 2126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698