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

Side by Side Diff: chrome/browser/dom_ui/dom_ui.cc

Issue 6269015: Add facility to fix about: and file: links from chrome:// pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more automatic Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/dom_ui/generic_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/dom_ui.h" 5 #include "chrome/browser/dom_ui/dom_ui.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "base/values.h" 12 #include "base/values.h"
13 #include "chrome/browser/dom_ui/generic_handler.h"
13 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
14 #include "chrome/browser/renderer_host/render_view_host.h" 15 #include "chrome/browser/renderer_host/render_view_host.h"
15 #include "chrome/browser/tab_contents/tab_contents.h" 16 #include "chrome/browser/tab_contents/tab_contents.h"
16 #include "chrome/browser/tab_contents/tab_contents_view.h" 17 #include "chrome/browser/tab_contents/tab_contents_view.h"
17 #include "chrome/browser/themes/browser_theme_provider.h" 18 #include "chrome/browser/themes/browser_theme_provider.h"
18 #include "chrome/common/bindings_policy.h" 19 #include "chrome/common/bindings_policy.h"
19 #include "chrome/common/render_messages.h" 20 #include "chrome/common/render_messages.h"
20 #include "chrome/common/render_messages_params.h" 21 #include "chrome/common/render_messages_params.h"
21 22
22 namespace { 23 namespace {
(...skipping 15 matching lines...) Expand all
38 } // namespace 39 } // namespace
39 40
40 DOMUI::DOMUI(TabContents* contents) 41 DOMUI::DOMUI(TabContents* contents)
41 : hide_favicon_(false), 42 : hide_favicon_(false),
42 force_bookmark_bar_visible_(false), 43 force_bookmark_bar_visible_(false),
43 focus_location_bar_by_default_(false), 44 focus_location_bar_by_default_(false),
44 should_hide_url_(false), 45 should_hide_url_(false),
45 link_transition_type_(PageTransition::LINK), 46 link_transition_type_(PageTransition::LINK),
46 bindings_(BindingsPolicy::DOM_UI), 47 bindings_(BindingsPolicy::DOM_UI),
47 tab_contents_(contents) { 48 tab_contents_(contents) {
49 GenericHandler* handler = new GenericHandler();
50 AddMessageHandler(handler->Attach(this));
48 } 51 }
49 52
50 DOMUI::~DOMUI() { 53 DOMUI::~DOMUI() {
51 STLDeleteContainerPairSecondPointers(message_callbacks_.begin(), 54 STLDeleteContainerPairSecondPointers(message_callbacks_.begin(),
52 message_callbacks_.end()); 55 message_callbacks_.end());
53 STLDeleteContainerPointers(handlers_.begin(), handlers_.end()); 56 STLDeleteContainerPointers(handlers_.begin(), handlers_.end());
54 } 57 }
55 58
56 // DOMUI, public: ------------------------------------------------------------- 59 // DOMUI, public: -------------------------------------------------------------
57 60
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 198 }
196 199
197 // TODO(viettrungluu): convert to string16 (or UTF-8 std::string?). 200 // TODO(viettrungluu): convert to string16 (or UTF-8 std::string?).
198 std::wstring DOMMessageHandler::ExtractStringValue(const ListValue* value) { 201 std::wstring DOMMessageHandler::ExtractStringValue(const ListValue* value) {
199 string16 string16_value; 202 string16 string16_value;
200 if (value->GetString(0, &string16_value)) 203 if (value->GetString(0, &string16_value))
201 return UTF16ToWideHack(string16_value); 204 return UTF16ToWideHack(string16_value);
202 NOTREACHED(); 205 NOTREACHED();
203 return std::wstring(); 206 return std::wstring();
204 } 207 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/dom_ui/generic_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698