Commit 58a27fbd authored by shrike's avatar shrike Committed by Commit bot
Browse files

[Mac][Material Design] Add temporary spinner for Incognito mode.

The tab spinner on the Mac will be replaced by a Material Design version
in a future cl. Until then, we need a white version of the current
spinner so that it's visible on Incognito tabs.

R=cpu@chromium.org
BUG=618778

Review-Url: https://codereview.chromium.org/2092193004
Cr-Commit-Position: refs/heads/master@{#402316}
parent 7577d9ed
......@@ -883,6 +883,8 @@
<structure type="chrome_scaled_image" name="IDR_THEME_WINDOW_CONTROL_BACKGROUND" file="notused.png" />
<if expr="is_macosx">
<structure type="chrome_scaled_image" name="IDR_THROBBER_WAITING" file="legacy/throbber_waiting.png" />
<structure type="chrome_scaled_image" name="IDR_THROBBER_WAITING_INCOGNITO" file="mac/throbber_waiting_incognito.png" />
<structure type="chrome_scaled_image" name="IDR_THROBBER_INCOGNITO" file="mac/throbber_incognito.png" />
</if>
<if expr="use_ash">
<structure type="chrome_scaled_image" name="IDR_TOOLBAR_SHADE_LEFT" file="common/toolbar_shade_left.png" />
......
......@@ -40,6 +40,7 @@
#import "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
#import "chrome/browser/ui/cocoa/tabs/tab_view.h"
#import "chrome/browser/ui/cocoa/themed_window.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
......@@ -1531,9 +1532,15 @@ private:
static NSImage* throbberWaitingImage =
ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_THROBBER_WAITING).CopyNSImage();
static NSImage* throbberWaitingIncognitoImage =
ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_THROBBER_WAITING_INCOGNITO).CopyNSImage();
static NSImage* throbberLoadingImage =
ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_THROBBER).CopyNSImage();
static NSImage* throbberLoadingIncognitoImage =
ResourceBundle::GetSharedInstance().GetNativeImageNamed(
IDR_THROBBER_INCOGNITO).CopyNSImage();
static NSImage* sadFaviconImage =
ResourceBundle::GetSharedInstance()
.GetNativeImageNamed(IDR_CRASH_SAD_FAVICON)
......@@ -1556,10 +1563,20 @@ private:
newHasIcon = true;
} else if (contents->IsWaitingForResponse()) {
newState = kTabWaiting;
throbberImage = throbberWaitingImage;
if (ui::MaterialDesignController::IsModeMaterial() &&
[[[tabController view] window] inIncognitoMode]) {
throbberImage = throbberWaitingIncognitoImage;
} else {
throbberImage = throbberWaitingImage;
}
} else if (contents->IsLoadingToDifferentDocument()) {
newState = kTabLoading;
throbberImage = throbberLoadingImage;
if (ui::MaterialDesignController::IsModeMaterial() &&
[[[tabController view] window] inIncognitoMode]) {
throbberImage = throbberLoadingIncognitoImage;
} else {
throbberImage = throbberLoadingImage;
}
}
if (oldState != newState)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment