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

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: Created 8 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
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 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 views::Background::CreateSolidBackground(bg_color)); 2216 views::Background::CreateSolidBackground(bg_color));
2217 AddChildView(contents_split_); 2217 AddChildView(contents_split_);
2218 set_contents_view(contents_split_); 2218 set_contents_view(contents_split_);
2219 2219
2220 status_bubble_.reset(new StatusBubbleViews(contents_)); 2220 status_bubble_.reset(new StatusBubbleViews(contents_));
2221 2221
2222 #if defined(OS_WIN) && !defined(USE_AURA) 2222 #if defined(OS_WIN) && !defined(USE_AURA)
2223 // Create a custom JumpList and add it to an observer of TabRestoreService 2223 // Create a custom JumpList and add it to an observer of TabRestoreService
2224 // so we can update the custom JumpList when a tab is added or removed. 2224 // so we can update the custom JumpList when a tab is added or removed.
2225 if (JumpList::Enabled()) { 2225 if (JumpList::Enabled()) {
2226 jumplist_ = new JumpList(); 2226 load_complete_listener_.reset(new LoadCompleteListener(this));
2227 jumplist_->AddObserver(browser_->profile());
2228 } 2227 }
2229 #endif 2228 #endif
2230 2229
2231 // We're now initialized and ready to process Layout requests. 2230 // We're now initialized and ready to process Layout requests.
2232 ignore_layout_ = false; 2231 ignore_layout_ = false;
2233 } 2232 }
2234 2233
2235 void BrowserView::LoadingAnimationCallback() { 2234 void BrowserView::LoadingAnimationCallback() {
2236 base::TimeTicks now = base::TimeTicks::Now(); 2235 base::TimeTicks now = base::TimeTicks::Now();
2237 if (!last_animation_time_.is_null()) { 2236 if (!last_animation_time_.is_null()) {
(...skipping 12 matching lines...) Expand all
2250 } else if (ShouldShowWindowIcon()) { 2249 } else if (ShouldShowWindowIcon()) {
2251 // ... or in the window icon area for popups and app windows. 2250 // ... or in the window icon area for popups and app windows.
2252 WebContents* web_contents = chrome::GetActiveWebContents(browser_.get()); 2251 WebContents* web_contents = chrome::GetActiveWebContents(browser_.get());
2253 // GetActiveWebContents can return NULL for example under Purify when 2252 // GetActiveWebContents can return NULL for example under Purify when
2254 // the animations are running slowly and this function is called on a timer 2253 // the animations are running slowly and this function is called on a timer
2255 // through LoadingAnimationCallback. 2254 // through LoadingAnimationCallback.
2256 frame_->UpdateThrobber(web_contents && web_contents->IsLoading()); 2255 frame_->UpdateThrobber(web_contents && web_contents->IsLoading());
2257 } 2256 }
2258 } 2257 }
2259 2258
2259 void BrowserView::OnLoadCompleted() {
2260 #if defined(OS_WIN) && !defined(USE_AURA)
sky 2012/12/20 01:46:28 Don't indent #ifs.
2261 DCHECK(!jumplist_);
2262 jumplist_ = new JumpList();
2263 jumplist_->AddObserver(browser_->profile());
2264 #endif
2265 }
2266
2260 // BrowserView, private -------------------------------------------------------- 2267 // BrowserView, private --------------------------------------------------------
2261 2268
2262 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { 2269 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const {
2263 return static_cast<BrowserViewLayout*>(GetLayoutManager()); 2270 return static_cast<BrowserViewLayout*>(GetLayoutManager());
2264 } 2271 }
2265 2272
2266 void BrowserView::LayoutStatusBubble() { 2273 void BrowserView::LayoutStatusBubble() {
2267 // In restored mode, the client area has a client edge between it and the 2274 // In restored mode, the client area has a client edge between it and the
2268 // frame. 2275 // frame.
2269 int overlap = StatusBubbleViews::kShadowThickness; 2276 int overlap = StatusBubbleViews::kShadowThickness;
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2801 modal_browser->window()->Activate(); 2808 modal_browser->window()->Activate();
2802 } 2809 }
2803 2810
2804 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2811 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2805 } 2812 }
2806 2813
2807 void BrowserView::MaybeStackBookmarkBarAtTop() { 2814 void BrowserView::MaybeStackBookmarkBarAtTop() {
2808 if (bookmark_bar_view_.get()) 2815 if (bookmark_bar_view_.get())
2809 bookmark_bar_view_->MaybeStackAtTop(); 2816 bookmark_bar_view_->MaybeStackAtTop();
2810 } 2817 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/load_complete_listener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698