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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 5790002: [gtk] tabcontents fade-out for instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile fixes Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 rwhv->DidBecomeSelected(); 791 rwhv->DidBecomeSelected();
792 #if defined(OS_MACOSX) 792 #if defined(OS_MACOSX)
793 rwhv->SetActive(true); 793 rwhv->SetActive(true);
794 #endif 794 #endif
795 } 795 }
796 796
797 WebCacheManager::GetInstance()->ObserveActivity(GetRenderProcessHost()->id()); 797 WebCacheManager::GetInstance()->ObserveActivity(GetRenderProcessHost()->id());
798 last_selected_time_ = base::TimeTicks::Now(); 798 last_selected_time_ = base::TimeTicks::Now();
799 } 799 }
800 800
801 void TabContents::FadeForInstant() {
802 RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
803 SkColor whitish = SkColorSetARGB(192, 255, 255, 255);
804 if (rwhv)
805 rwhv->SetVisuallyDeemphasized(&whitish, true);
806 }
807
808 void TabContents::CancelInstantFade() {
809 RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
810 if (rwhv)
811 rwhv->SetVisuallyDeemphasized(NULL, false);
812 }
813
801 void TabContents::WasHidden() { 814 void TabContents::WasHidden() {
802 if (!capturing_contents()) { 815 if (!capturing_contents()) {
803 // |render_view_host()| can be NULL if the user middle clicks a link to open 816 // |render_view_host()| can be NULL if the user middle clicks a link to open
804 // a tab in then background, then closes the tab before selecting it. This 817 // a tab in then background, then closes the tab before selecting it. This
805 // is because closing the tab calls TabContents::Destroy(), which removes 818 // is because closing the tab calls TabContents::Destroy(), which removes
806 // the |render_view_host()|; then when we actually destroy the window, 819 // the |render_view_host()|; then when we actually destroy the window,
807 // OnWindowPosChanged() notices and calls HideContents() (which calls us). 820 // OnWindowPosChanged() notices and calls HideContents() (which calls us).
808 RenderWidgetHostView* rwhv = GetRenderWidgetHostView(); 821 RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
809 if (rwhv) 822 if (rwhv)
810 rwhv->WasHidden(); 823 rwhv->WasHidden();
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 if (child_windows_.size() == 1) { 979 if (child_windows_.size() == 1) {
967 window->ShowConstrainedWindow(); 980 window->ShowConstrainedWindow();
968 BlockTabContent(true); 981 BlockTabContent(true);
969 } 982 }
970 983
971 return window; 984 return window;
972 } 985 }
973 986
974 void TabContents::BlockTabContent(bool blocked) { 987 void TabContents::BlockTabContent(bool blocked) {
975 RenderWidgetHostView* rwhv = GetRenderWidgetHostView(); 988 RenderWidgetHostView* rwhv = GetRenderWidgetHostView();
989 // 70% opaque grey.
990 SkColor greyish = SkColorSetARGB(178, 0, 0, 0);
976 if (rwhv) 991 if (rwhv)
977 rwhv->SetVisuallyDeemphasized(blocked); 992 rwhv->SetVisuallyDeemphasized(blocked ? &greyish : NULL, false);
978 render_view_host()->set_ignore_input_events(blocked); 993 render_view_host()->set_ignore_input_events(blocked);
979 if (delegate_) 994 if (delegate_)
980 delegate_->SetTabContentBlocked(this, blocked); 995 delegate_->SetTabContentBlocked(this, blocked);
981 } 996 }
982 997
983 void TabContents::AddNewContents(TabContents* new_contents, 998 void TabContents::AddNewContents(TabContents* new_contents,
984 WindowOpenDisposition disposition, 999 WindowOpenDisposition disposition,
985 const gfx::Rect& initial_pos, 1000 const gfx::Rect& initial_pos,
986 bool user_gesture) { 1001 bool user_gesture) {
987 if (all_contents_blocked_) { 1002 if (all_contents_blocked_) {
(...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after
3282 } 3297 }
3283 3298
3284 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { 3299 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) {
3285 render_manager_.SwapInRenderViewHost(rvh); 3300 render_manager_.SwapInRenderViewHost(rvh);
3286 } 3301 }
3287 3302
3288 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 3303 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
3289 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 3304 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
3290 rwh_view->SetSize(view()->GetContainerSize()); 3305 rwh_view->SetSize(view()->GetContainerSize());
3291 } 3306 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698