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

Unified Diff: chrome/android/java_staging/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkActivity.java

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? 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 side-by-side diff with in-line comments
Download patch
Index: chrome/android/java_staging/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkActivity.java
diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkActivity.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkActivity.java
new file mode 100644
index 0000000000000000000000000000000000000000..3c8ca05c038e61d3eee80da6541683ed6f37ef1b
--- /dev/null
+++ b/chrome/android/java_staging/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkActivity.java
@@ -0,0 +1,55 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.enhancedbookmarks;
+
+import android.os.Bundle;
+
+import com.google.android.apps.chrome.R;
+
+import org.chromium.chrome.browser.snackbar.SnackbarManager;
+import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarManageable;
+
+/**
+ * The activity that wraps all enhanced bookmark UI on the phone. It keeps a
+ * {@link EnhancedBookmarkManager} inside of it and creates a snackbar manager. This activity
+ * should only be shown on phones; on tablet the enhanced bookmark UI is shown inside of a tab (see
+ * {@link EnhancedBookmarkPage}).
+ */
+public class EnhancedBookmarkActivity extends EnhancedBookmarkActivityBase implements
+ SnackbarManageable {
+
+ private EnhancedBookmarkManager mBookmarkManager;
+ private SnackbarManager mSnackbarManager;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ mSnackbarManager = new SnackbarManager(findViewById(android.R.id.content));
+ mBookmarkManager = new EnhancedBookmarkManager(this);
+ setContentView(mBookmarkManager.getView());
+ getWindow().setBackgroundDrawable(null);
+ EnhancedBookmarkUtils.setTaskDescriptionInDocumentMode(this, getString(R.string.bookmarks));
+
+ // Hack to work around inferred theme false lint error: http://crbug.com/445633
+ assert (R.layout.eb_main_content != 0);
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ mBookmarkManager.destroy();
+ mSnackbarManager.dismissSnackbar(false);
+ }
+
+ @Override
+ public SnackbarManager getSnackbarManager() {
+ return mSnackbarManager;
+ }
+
+ @Override
+ public void onBackPressed() {
+ if (!mBookmarkManager.onBackPressed()) super.onBackPressed();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698