On Mon, Apr 27, 2009 at 10:40 AM, Evan Martin <[email protected]> wrote:
> Though I don't understand the context of your discussion, we do have a
> notion of "page id" (which is a per-renderer monotonic integer) as
> well as both URL-level ids and page-visit ids in history (which are
> probably hard to get at since you have to round-trip through the
> history thread).

Great, we would just reuse that, then.

On Mon, Apr 27, 2009 at 10:48 AM, Erik Kay <[email protected]> wrote:
> What does using a page ID buy us over using an URL directly?

Well, with a URL, you need to specify both a tab ID and the URL. I was
looking for a single value that would uniquely identify this pair.

>> Separately, I was thinking over the weekend that we could simplify
>> this API and consolidate the temporary and permanent versions like
>> this:
>>
>> // Manifest
>> "page_actions": [
>>  {
>>    "id": "foo",  // Required. Chosen by the developer,
>> namespaced/unique by extension
>>    "title": "Add to delicious...",  // Required.
>>    "type": "temporary"  // Optional, "temporary" or "permanent".
>> Defaults to "permanent".
>>  }
>> ]
>
> I like this way of pre-defining the page actions via the manifest.  As you
> said, it simplifies the API, but I think it also gives us more opportunities
> for caching, and will likely improve performance of the feature in general.
>  It appears you're missing the icon though.  I'm not sure you need the
> 'type' field in the pre-definition though since the API calls will provide
> that implicitly.

You're right, I was missing the icon. The reason for the type field is
that we want to have the temporary page actions disabled by default
until the developer calls an API to enable them for a specific tab. So
we need to distinguish the two at registration time.

> I can't think of an example where you'd need 'type' passed back to you, but
> you do need the pageActionId.
> If we use a pageID here, then how is that used by the developer?  Do they
> need to make a round-trip to look up the URL associated with it?  Or are
> they supposed to keep a local map of recent pageID to URL?

I meant ID for the callback parameter, sorry. I don't know how a "page
ID" would be used exactly. There would need to be some way to get from
it to a tab or a document. Need to flesh that out.

- a

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to