OLD | NEW |
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 "content/browser/intents/intent_injector.h" | 5 #include "content/browser/intents/intent_injector.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "content/browser/renderer_host/render_view_host.h" | 10 #include "content/browser/renderer_host/render_view_host.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 source_intent_.reset(new webkit_glue::WebIntentData(intent)); | 44 source_intent_.reset(new webkit_glue::WebIntentData(intent)); |
45 intent_id_ = intent_id; | 45 intent_id_ = intent_id; |
46 | 46 |
47 SendIntent(); | 47 SendIntent(); |
48 } | 48 } |
49 | 49 |
50 void IntentInjector::RenderViewCreated(RenderViewHost* host) { | 50 void IntentInjector::RenderViewCreated(RenderViewHost* host) { |
51 SendIntent(); | 51 SendIntent(); |
52 } | 52 } |
53 | 53 |
54 void IntentInjector::DidNavigateMainFramePostCommit( | 54 void IntentInjector::DidNavigateMainFrame( |
55 const content::LoadCommittedDetails& details, | 55 const content::LoadCommittedDetails& details, |
56 const ViewHostMsg_FrameNavigate_Params& params) { | 56 const ViewHostMsg_FrameNavigate_Params& params) { |
57 SendIntent(); | 57 SendIntent(); |
58 } | 58 } |
59 | 59 |
60 // TODO(gbillock): The "correct" thing here is for this to be a | 60 // TODO(gbillock): The "correct" thing here is for this to be a |
61 // RenderViewHostObserver, and do this on RenderViewHostInitialized. There's no | 61 // RenderViewHostObserver, and do this on RenderViewHostInitialized. There's no |
62 // good hooks for attaching the intent to such an object, though. All RVHOs get | 62 // good hooks for attaching the intent to such an object, though. All RVHOs get |
63 // made deep inside tab contents initialization. Idea: propagate out | 63 // made deep inside tab contents initialization. Idea: propagate out |
64 // RenderViewHostInitialized to a TabContentsObserver latch? That still looks | 64 // RenderViewHostInitialized to a TabContentsObserver latch? That still looks |
(...skipping 29 matching lines...) Expand all Loading... |
94 int intent_id) { | 94 int intent_id) { |
95 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) | 95 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
96 NOTREACHED(); | 96 NOTREACHED(); |
97 | 97 |
98 if (source_tab_.get() != NULL) { | 98 if (source_tab_.get() != NULL) { |
99 source_tab_->Send(new IntentsMsg_WebIntentReply( | 99 source_tab_->Send(new IntentsMsg_WebIntentReply( |
100 0, reply_type, data, intent_id)); | 100 0, reply_type, data, intent_id)); |
101 source_tab_.reset(NULL); | 101 source_tab_.reset(NULL); |
102 } | 102 } |
103 } | 103 } |
OLD | NEW |