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

Side by Side Diff: chrome/renderer/extensions/extension_helper.cc

Issue 12226045: Linux/ChromeOS Chromium style checker cleanup, chrome/ edition part 1. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 10 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/renderer/extensions/extension_helper.h" 5 #include "chrome/renderer/extensions/extension_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 int browser_window_id, 68 int browser_window_id,
69 chrome::ViewType view_type) 69 chrome::ViewType view_type)
70 : extension_id_(extension_id), 70 : extension_id_(extension_id),
71 browser_window_id_(browser_window_id), 71 browser_window_id_(browser_window_id),
72 view_type_(view_type) { 72 view_type_(view_type) {
73 } 73 }
74 74
75 std::vector<content::RenderView*> views() { return views_; } 75 std::vector<content::RenderView*> views() { return views_; }
76 76
77 // Returns false to terminate the iteration. 77 // Returns false to terminate the iteration.
78 virtual bool Visit(content::RenderView* render_view) { 78 virtual bool Visit(content::RenderView* render_view) OVERRIDE {
79 ExtensionHelper* helper = ExtensionHelper::Get(render_view); 79 ExtensionHelper* helper = ExtensionHelper::Get(render_view);
80 if (!ViewTypeMatches(helper->view_type(), view_type_)) 80 if (!ViewTypeMatches(helper->view_type(), view_type_))
81 return true; 81 return true;
82 82
83 GURL url = render_view->GetWebView()->mainFrame()->document().url(); 83 GURL url = render_view->GetWebView()->mainFrame()->document().url();
84 if (!url.SchemeIs(extensions::kExtensionScheme)) 84 if (!url.SchemeIs(extensions::kExtensionScheme))
85 return true; 85 return true;
86 const std::string& extension_id = url.host(); 86 const std::string& extension_id = url.host();
87 if (extension_id != extension_id_) 87 if (extension_id != extension_id_)
88 return true; 88 return true;
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 case content::CONSOLE_MESSAGE_LEVEL_ERROR: 536 case content::CONSOLE_MESSAGE_LEVEL_ERROR:
537 target_level = WebConsoleMessage::LevelError; 537 target_level = WebConsoleMessage::LevelError;
538 break; 538 break;
539 } 539 }
540 render_view()->GetWebView()->mainFrame()->addMessageToConsole( 540 render_view()->GetWebView()->mainFrame()->addMessageToConsole(
541 WebConsoleMessage(target_level, message)); 541 WebConsoleMessage(target_level, message));
542 } 542 }
543 } 543 }
544 544
545 } // namespace extensions 545 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/event_bindings.cc ('k') | chrome/renderer/extensions/miscellaneous_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698