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

Side by Side Diff: chrome/browser/ui/intents/web_intent_inline_disposition_delegate.cc

Issue 9959130: [Web Intents] Display throbber when loading inline disposition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/intents/web_intent_inline_disposition_delegate.h" 5 #include "chrome/browser/ui/intents/web_intent_inline_disposition_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/ui/intents/web_intent_picker.h"
8 #include "content/public/browser/navigation_controller.h" 9 #include "content/public/browser/navigation_controller.h"
9 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
10 11
11 WebIntentInlineDispositionDelegate::WebIntentInlineDispositionDelegate() { 12 WebIntentInlineDispositionDelegate::WebIntentInlineDispositionDelegate(
13 WebIntentPicker* picker)
14 : picker_(picker) {
12 } 15 }
13 16
14 WebIntentInlineDispositionDelegate::~WebIntentInlineDispositionDelegate() { 17 WebIntentInlineDispositionDelegate::~WebIntentInlineDispositionDelegate() {
15 } 18 }
16 19
17 bool WebIntentInlineDispositionDelegate::IsPopupOrPanel( 20 bool WebIntentInlineDispositionDelegate::IsPopupOrPanel(
18 const content::WebContents* source) const { 21 const content::WebContents* source) const {
19 return true; 22 return true;
20 } 23 }
21 24
22 bool WebIntentInlineDispositionDelegate::ShouldAddNavigationToHistory( 25 bool WebIntentInlineDispositionDelegate::ShouldAddNavigationToHistory(
23 const history::HistoryAddPageArgs& add_page_args, 26 const history::HistoryAddPageArgs& add_page_args,
24 content::NavigationType navigation_type) { 27 content::NavigationType navigation_type) {
25 return false; 28 return false;
26 } 29 }
27 30
28 content::WebContents* WebIntentInlineDispositionDelegate::OpenURLFromTab( 31 content::WebContents* WebIntentInlineDispositionDelegate::OpenURLFromTab(
29 content::WebContents* source, const content::OpenURLParams& params) { 32 content::WebContents* source, const content::OpenURLParams& params) {
30 DCHECK(source); // Can only be invoked from inline disposition. 33 DCHECK(source); // Can only be invoked from inline disposition.
31 34
32 // Load in place. 35 // Load in place.
33 source->GetController().LoadURL(params.url, content::Referrer(), 36 source->GetController().LoadURL(params.url, content::Referrer(),
34 content::PAGE_TRANSITION_START_PAGE, std::string()); 37 content::PAGE_TRANSITION_START_PAGE, std::string());
35 38
36 // Remove previous history entries - users should not navigate in intents. 39 // Remove previous history entries - users should not navigate in intents.
37 source->GetController().PruneAllButActive(); 40 source->GetController().PruneAllButActive();
38 41
39 return source; 42 return source;
40 } 43 }
44
45 void WebIntentInlineDispositionDelegate::LoadingStateChanged(
46 content::WebContents* source) {
47 if (!source->IsLoading()) {
James Hawkins 2012/04/11 18:05:46 Optional nit: Save a line by removing braces.
binji 2012/04/12 17:48:49 Done.
48 picker_->OnInlineDispositionWebContentsLoaded(source);
49 }
50 }
51
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698