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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 11515005: Delay updating jumplist to avoid blocking the file thread at start-up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2229 views::Background::CreateSolidBackground(bg_color)); 2229 views::Background::CreateSolidBackground(bg_color));
2230 AddChildView(contents_split_); 2230 AddChildView(contents_split_);
2231 set_contents_view(contents_split_); 2231 set_contents_view(contents_split_);
2232 2232
2233 status_bubble_.reset(new StatusBubbleViews(contents_)); 2233 status_bubble_.reset(new StatusBubbleViews(contents_));
2234 2234
2235 #if defined(OS_WIN) && !defined(USE_AURA) 2235 #if defined(OS_WIN) && !defined(USE_AURA)
2236 // Create a custom JumpList and add it to an observer of TabRestoreService 2236 // Create a custom JumpList and add it to an observer of TabRestoreService
2237 // so we can update the custom JumpList when a tab is added or removed. 2237 // so we can update the custom JumpList when a tab is added or removed.
2238 if (JumpList::Enabled()) { 2238 if (JumpList::Enabled()) {
2239 jumplist_ = new JumpList(); 2239 load_complete_listener_.reset(new LoadCompleteListener(this));
2240 jumplist_->AddObserver(browser_->profile());
2241 } 2240 }
2242 #endif 2241 #endif
2243 2242
2244 // We're now initialized and ready to process Layout requests. 2243 // We're now initialized and ready to process Layout requests.
2245 ignore_layout_ = false; 2244 ignore_layout_ = false;
2246 } 2245 }
2247 2246
2248 void BrowserView::LoadingAnimationCallback() { 2247 void BrowserView::LoadingAnimationCallback() {
2249 base::TimeTicks now = base::TimeTicks::Now(); 2248 base::TimeTicks now = base::TimeTicks::Now();
2250 if (!last_animation_time_.is_null()) { 2249 if (!last_animation_time_.is_null()) {
(...skipping 12 matching lines...) Expand all
2263 } else if (ShouldShowWindowIcon()) { 2262 } else if (ShouldShowWindowIcon()) {
2264 // ... or in the window icon area for popups and app windows. 2263 // ... or in the window icon area for popups and app windows.
2265 WebContents* web_contents = chrome::GetActiveWebContents(browser_.get()); 2264 WebContents* web_contents = chrome::GetActiveWebContents(browser_.get());
2266 // GetActiveWebContents can return NULL for example under Purify when 2265 // GetActiveWebContents can return NULL for example under Purify when
2267 // the animations are running slowly and this function is called on a timer 2266 // the animations are running slowly and this function is called on a timer
2268 // through LoadingAnimationCallback. 2267 // through LoadingAnimationCallback.
2269 frame_->UpdateThrobber(web_contents && web_contents->IsLoading()); 2268 frame_->UpdateThrobber(web_contents && web_contents->IsLoading());
2270 } 2269 }
2271 } 2270 }
2272 2271
2272 void BrowserView::OnLoadCompleted() {
2273 #if defined(OS_WIN) && !defined(USE_AURA)
2274 DCHECK(!jumplist_);
2275 jumplist_ = new JumpList();
2276 jumplist_->AddObserver(browser_->profile());
2277 #endif
2278 }
2279
2273 // BrowserView, private -------------------------------------------------------- 2280 // BrowserView, private --------------------------------------------------------
2274 2281
2275 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { 2282 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const {
2276 return static_cast<BrowserViewLayout*>(GetLayoutManager()); 2283 return static_cast<BrowserViewLayout*>(GetLayoutManager());
2277 } 2284 }
2278 2285
2279 void BrowserView::LayoutStatusBubble() { 2286 void BrowserView::LayoutStatusBubble() {
2280 // In restored mode, the client area has a client edge between it and the 2287 // In restored mode, the client area has a client edge between it and the
2281 // frame. 2288 // frame.
2282 int overlap = StatusBubbleViews::kShadowThickness; 2289 int overlap = StatusBubbleViews::kShadowThickness;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 modal_browser->window()->Activate(); 2821 modal_browser->window()->Activate();
2815 } 2822 }
2816 2823
2817 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2824 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2818 } 2825 }
2819 2826
2820 void BrowserView::MaybeStackBookmarkBarAtTop() { 2827 void BrowserView::MaybeStackBookmarkBarAtTop() {
2821 if (bookmark_bar_view_.get()) 2828 if (bookmark_bar_view_.get())
2822 bookmark_bar_view_->MaybeStackAtTop(); 2829 bookmark_bar_view_->MaybeStackAtTop();
2823 } 2830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698