summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-08 03:02:51 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-08 03:02:51 +0000
commitfd1b8ea1c39a8b99285bdca24e22731f463e63d8 (patch)
tree8ee89c484c5a1e5e8b91884494def1b5a26a001e /chrome
parent981f62b8c54124f3ff500d5ce4dcdee37d597815 (diff)
downloadchromium_src-fd1b8ea1c39a8b99285bdca24e22731f463e63d8.zip
chromium_src-fd1b8ea1c39a8b99285bdca24e22731f463e63d8.tar.gz
chromium_src-fd1b8ea1c39a8b99285bdca24e22731f463e63d8.tar.bz2
Disable extension app tab throbber if command line flag set.
This is a temporary measure until we have a better throbber for extension app tabs (or we remove them). BUG=None TEST=Pass in --disable-throbber-for-extension-apps and make sure the icon for nano tabs don't get replaced by a throbber. Review URL: http://codereview.chromium.org/2032003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/tabs/tab_renderer.cc12
-rw-r--r--chrome/browser/views/tabs/tab_renderer.h5
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
4 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc
index 0d912d0..a6404bb 100644
--- a/chrome/browser/views/tabs/tab_renderer.cc
+++ b/chrome/browser/views/tabs/tab_renderer.cc
@@ -12,6 +12,7 @@
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
#include "app/throb_animation.h"
+#include "base/command_line.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_theme_provider.h"
@@ -19,6 +20,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
+#include "chrome/common/chrome_switches.h"
#include "gfx/canvas.h"
#include "gfx/favicon_size.h"
#include "gfx/font.h"
@@ -271,6 +273,7 @@ class TabRenderer::FavIconCrashAnimation : public LinearAnimation,
TabRenderer::TabRenderer()
: animation_state_(ANIMATION_NONE),
animation_frame_(0),
+ throbber_disabled_(false),
showing_icon_(false),
showing_close_button_(false),
fav_icon_hiding_offset_(0),
@@ -338,6 +341,12 @@ void TabRenderer::UpdateData(TabContents* contents,
SetAccessibleName(UTF16ToWide(data_.title));
}
+ // If this is an extension app and a command line flag is set,
+ // then disable the throbber.
+ throbber_disabled_ = data_.app &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableThrobberForExtensionApps);
+
// TODO(glen): Temporary hax.
theme_provider_ = contents->profile()->GetThemeProvider();
@@ -371,6 +380,9 @@ bool TabRenderer::IsSelected() const {
}
void TabRenderer::ValidateLoadingAnimation(AnimationState animation_state) {
+ if (throbber_disabled_)
+ return;
+
if (animation_state_ != animation_state) {
// The waiting animation is the reverse of the loading animation, but at a
// different rate - the following reverses and scales the animation_frame_
diff --git a/chrome/browser/views/tabs/tab_renderer.h b/chrome/browser/views/tabs/tab_renderer.h
index d09b977..2ae8be99 100644
--- a/chrome/browser/views/tabs/tab_renderer.h
+++ b/chrome/browser/views/tabs/tab_renderer.h
@@ -219,6 +219,11 @@ class TabRenderer : public views::View,
// Close Button.
views::ImageButton* close_button_;
+ // Whether to disable throbber animations. Only true if this is a
+ // Nano tab renderer and a command line flag has been passed in to
+ // disable the animations.
+ bool throbber_disabled_;
+
// Hover animation.
scoped_ptr<SlideAnimation> hover_animation_;
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 1ff4234..0e9e3455 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -193,6 +193,10 @@ const char kDisableSyncThemes[] = "disable-sync-themes";
// Disable syncing of typed urls.
const char kDisableSyncTypedUrls[] = "disable-sync-typed-urls";
+// Disable throbber for extension apps.
+const char kDisableThrobberForExtensionApps[] =
+ "disable-throbber-for-extension-apps";
+
// Enables the backend service for web resources, used in the new tab page for
// loading tips and recommendations from a JSON feed.
const char kDisableWebResources[] = "disable-web-resources";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 6f26974..936467f 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -70,6 +70,7 @@ extern const char kDisableSyncBookmarks[];
extern const char kDisableSyncPreferences[];
extern const char kDisableSyncThemes[];
extern const char kDisableSyncTypedUrls[];
+extern const char kDisableThrobberForExtensionApps[];
extern const char kDisableWebResources[];
extern const char kDisableWebSecurity[];
extern const char kDisableWebSockets[];