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

Unified Diff: chrome/android/java_staging/src/org/chromium/chrome/browser/bookmark/ShortcutActivity.java

Issue 1206673003: Merge java_staging/src into java/src. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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/bookmark/ShortcutActivity.java
diff --git a/chrome/android/java_staging/src/org/chromium/chrome/browser/bookmark/ShortcutActivity.java b/chrome/android/java_staging/src/org/chromium/chrome/browser/bookmark/ShortcutActivity.java
deleted file mode 100644
index ef8c8af6044af264fe286424cd06ebdf8447edae..0000000000000000000000000000000000000000
--- a/chrome/android/java_staging/src/org/chromium/chrome/browser/bookmark/ShortcutActivity.java
+++ /dev/null
@@ -1,88 +0,0 @@
-// 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.bookmark;
-
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.graphics.Color;
-import android.view.ViewGroup;
-
-import org.chromium.chrome.R;
-import org.chromium.chrome.browser.BookmarkUtils;
-import org.chromium.chrome.browser.UrlConstants;
-import org.chromium.chrome.browser.favicon.FaviconHelper;
-import org.chromium.chrome.browser.init.AsyncInitializationActivity;
-import org.chromium.chrome.browser.ntp.BookmarksPage;
-import org.chromium.chrome.browser.ntp.BookmarksPage.BookmarkSelectedListener;
-import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
-import org.chromium.chrome.browser.profiles.Profile;
-
-/**
- * Activity that allows the user to select a bookmark to add to their homescreen as a shortcut.
- */
-public class ShortcutActivity extends AsyncInitializationActivity implements
- BookmarkSelectedListener {
- private BookmarksPage mBookmarksPage;
-
- @Override
- protected void setContentView() {
- // We can't show anything until the native library is loaded.
- }
-
- @Override
- public void postInflationStartup() {
- setTitle(getResources().getString(R.string.bookmark_shortcut_choose_bookmark));
- }
-
- @Override
- public void initializeState() {
- super.initializeState();
-
- // Partner bookmarks need to be loaded explicitly.
- PartnerBookmarksShim.kickOffReading(this);
-
- Profile profile = Profile.getLastUsedProfile();
- mBookmarksPage = BookmarksPage.buildPageInSelectBookmarkMode(this, profile, this);
- mBookmarksPage.updateForUrl(UrlConstants.BOOKMARKS_URL);
-
- setContentView(mBookmarksPage.getView(), new ViewGroup.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT));
- }
-
- @Override
- public void onDestroy() {
- super.onDestroy();
- if (mBookmarksPage != null) {
- mBookmarksPage.destroy();
- mBookmarksPage = null;
- }
- }
-
- // BookmarkSelectedListener implementation
-
- @Override
- public void onNewTabOpened() {
- }
-
- @Override
- public void onBookmarkSelected(String url, String title, Bitmap favicon) {
- int dominantColor = FaviconHelper.getDominantColorForBitmap(favicon);
- Bitmap launcherIcon = BookmarkUtils.createLauncherIcon(this, favicon, url,
- Color.red(dominantColor), Color.green(dominantColor), Color.blue(dominantColor));
- Intent intent = BookmarkUtils.createAddToHomeIntent(url, title, launcherIcon);
- setResult(RESULT_OK, intent);
- finish();
- }
-
- @Override
- public void onResumeWithNative() { }
-
- @Override
- public void onPauseWithNative() { }
-
- @Override
- public void onStopWithNative() { }
-}

Powered by Google App Engine
This is Rietveld 408576698