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

Side by Side Diff: chrome/browser/chromeos/login/web_page_view.cc

Issue 7812036: Update base/timer.h code to pass through Location from call sites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromeos/login/web_page_view.h" 5 #include "chrome/browser/chromeos/login/web_page_view.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 AddChildView(throbber_); 116 AddChildView(throbber_);
117 117
118 connecting_label_ = new views::Label(); 118 connecting_label_ = new views::Label();
119 connecting_label_->SetText( 119 connecting_label_->SetText(
120 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOAD_STATE_CONNECTING))); 120 UTF16ToWide(l10n_util::GetStringUTF16(IDS_LOAD_STATE_CONNECTING)));
121 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 121 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
122 connecting_label_->SetFont(rb.GetFont(ResourceBundle::MediumFont)); 122 connecting_label_->SetFont(rb.GetFont(ResourceBundle::MediumFont));
123 connecting_label_->SetVisible(false); 123 connecting_label_->SetVisible(false);
124 AddChildView(connecting_label_ ); 124 AddChildView(connecting_label_ );
125 125
126 start_timer_.Start(TimeDelta::FromMilliseconds(kStartDelayMs), 126 start_timer_.Start(FROM_HERE,
127 TimeDelta::FromMilliseconds(kStartDelayMs),
127 this, 128 this,
128 &WebPageView::ShowWaitingControls); 129 &WebPageView::ShowWaitingControls);
129 } 130 }
130 131
131 void WebPageView::InitDOM(Profile* profile, 132 void WebPageView::InitDOM(Profile* profile,
132 SiteInstance* site_instance) { 133 SiteInstance* site_instance) {
133 dom_view()->Init(profile, site_instance); 134 dom_view()->Init(profile, site_instance);
134 } 135 }
135 136
136 void WebPageView::LoadURL(const GURL& url) { 137 void WebPageView::LoadURL(const GURL& url) {
137 dom_view()->LoadURL(url); 138 dom_view()->LoadURL(url);
138 } 139 }
139 140
140 void WebPageView::SetTabContentsDelegate( 141 void WebPageView::SetTabContentsDelegate(
141 TabContentsDelegate* delegate) { 142 TabContentsDelegate* delegate) {
142 dom_view()->SetTabContentsDelegate(delegate); 143 dom_view()->SetTabContentsDelegate(delegate);
143 } 144 }
144 145
145 void WebPageView::SetWebPageDelegate(WebPageDelegate* delegate) { 146 void WebPageView::SetWebPageDelegate(WebPageDelegate* delegate) {
146 dom_view()->set_web_page_delegate(delegate); 147 dom_view()->set_web_page_delegate(delegate);
147 } 148 }
148 149
149 void WebPageView::ShowPageContent() { 150 void WebPageView::ShowPageContent() {
150 // TODO(nkostylev): Show throbber as an overlay until page has been rendered. 151 // TODO(nkostylev): Show throbber as an overlay until page has been rendered.
151 start_timer_.Stop(); 152 start_timer_.Stop();
152 if (!stop_timer_.IsRunning()) { 153 if (!stop_timer_.IsRunning()) {
153 stop_timer_.Start(TimeDelta::FromMilliseconds(kStopDelayMs), 154 stop_timer_.Start(FROM_HERE,
155 TimeDelta::FromMilliseconds(kStopDelayMs),
154 this, 156 this,
155 &WebPageView::ShowRenderedPage); 157 &WebPageView::ShowRenderedPage);
156 } 158 }
157 } 159 }
158 160
159 /////////////////////////////////////////////////////////////////////////////// 161 ///////////////////////////////////////////////////////////////////////////////
160 // WebPageView, private: 162 // WebPageView, private:
161 163
162 void WebPageView::ShowRenderedPage() { 164 void WebPageView::ShowRenderedPage() {
163 throbber_->Stop(); 165 throbber_->Stop();
(...skipping 18 matching lines...) Expand all
182 throbber_->GetPreferredSize().width(), 184 throbber_->GetPreferredSize().width(),
183 throbber_->GetPreferredSize().height()); 185 throbber_->GetPreferredSize().height());
184 connecting_label_->SetBounds( 186 connecting_label_->SetBounds(
185 width() / 2 - connecting_label_->GetPreferredSize().width() / 2, 187 width() / 2 - connecting_label_->GetPreferredSize().width() / 2,
186 y + throbber_->GetPreferredSize().height() + kSpacing, 188 y + throbber_->GetPreferredSize().height() + kSpacing,
187 connecting_label_->GetPreferredSize().width(), 189 connecting_label_->GetPreferredSize().width(),
188 connecting_label_->GetPreferredSize().height()); 190 connecting_label_->GetPreferredSize().height());
189 } 191 }
190 192
191 } // namespace chromeos 193 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/web_page_screen.cc ('k') | chrome/browser/chromeos/login/wizard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698